tests: test-archive.t use mercurial.util for urllib compat
authortimeless <timeless@mozdev.org>
Fri, 06 May 2016 19:24:25 +0000
changeset 29183 6def44ab4769
parent 29182 6c0b1d964537
child 29184 09d0022cad83
tests: test-archive.t use mercurial.util for urllib compat
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