Patchwork [3,of,4] py3: byteify an inline python test extension

login
register
mail settings
Submitter Matt Harbison
Date Sept. 26, 2018, 4:06 a.m.
Message ID <50c1d7b011486167aa39.1537934763@Envy>
Download mbox | patch
Permalink /patch/35039/
State Accepted
Headers show

Comments

Matt Harbison - Sept. 26, 2018, 4:06 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1537927877 14400
#      Tue Sep 25 22:11:17 2018 -0400
# Node ID 50c1d7b011486167aa39dec26aa6642938010ef2
# Parent  b5d88137328115c98cdec6ae3902b6128823368d
py3: byteify an inline python test extension

# skip-blame for b'' prefixing

Patch

diff --git a/tests/test-largefiles-wireproto.t b/tests/test-largefiles-wireproto.t
--- a/tests/test-largefiles-wireproto.t
+++ b/tests/test-largefiles-wireproto.t
@@ -424,12 +424,12 @@  a large file from the server rather than
   > import base64
   > from mercurial.hgweb import common
   > def perform_authentication(hgweb, req, op):
-  >     auth = req.headers.get('Authorization')
+  >     auth = req.headers.get(b'Authorization')
   >     if not auth:
-  >         raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who',
-  >                 [('WWW-Authenticate', 'Basic Realm="mercurial"')])
-  >     if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']:
-  >         raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no')
+  >         raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, b'who',
+  >                 [(b'WWW-Authenticate', b'Basic Realm="mercurial"')])
+  >     if base64.b64decode(auth.split()[1]).split(b':', 1) != [b'user', b'pass']:
+  >         raise common.ErrorResponse(common.HTTP_FORBIDDEN, b'no')
   > def extsetup():
   >     common.permhooks.insert(0, perform_authentication)
   > EOT