Patchwork [5,of,5] tests: test-archive.t use mercurial.util for urllib compat

login
register
mail settings
Submitter timeless
Date May 11, 2016, 5:21 a.m.
Message ID <401c5c11d34ffc7dc226.1462944066@gcc2-power8.osuosl.org>
Download mbox | patch
Permalink /patch/15003/
State Accepted
Delegated to: Yuya Nishihara
Headers show

Comments

timeless - May 11, 2016, 5:21 a.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1462562665 0
#      Fri May 06 19:24:25 2016 +0000
# Node ID 401c5c11d34ffc7dc226bffe5612ba9bcdc686b7
# Parent  a76f8fe3523dcf1cca1111e7311579bf11f420c2
# EXP-Topic runtests
# Available At bb://timeless/mercurial-crew
#              hg pull bb://timeless/mercurial-crew -r 401c5c11d34f
tests: test-archive.t use mercurial.util for urllib compat

Patch

diff -r a76f8fe3523d -r 401c5c11d34f tests/test-archive.t
--- a/tests/test-archive.t	Fri May 06 19:19:12 2016 +0000
+++ b/tests/test-archive.t	Fri May 06 19:24:25 2016 +0000
@@ -72,7 +72,9 @@ 
   > from __future__ import absolute_import
   > import os
   > import sys
-  > import urllib2
+  > from mercurial import (
+  >     util,
+  > )
   > try:
   >     # Set stdout to binary mode for win32 platforms
   >     import msvcrt
@@ -90,10 +92,10 @@ 
   > except AttributeError:
   >     stdout = sys.stdout
   > try:
-  >     f = urllib2.urlopen('http://127.0.0.1:%s/?%s'
+  >     f = util.urlreq.urlopen('http://127.0.0.1:%s/?%s'
   >                     % (os.environ['HGPORT'], requeststr))
   >     stdout.write(f.read())
-  > except urllib2.HTTPError, e:
+  > except util.urlerr.httperror as e:
   >     sys.stderr.write(str(e) + '\n')
   > EOF
   $ python getarchive.py "$TIP" gz | gunzip | tar tf - 2>/dev/null