changeset 29183:6def44ab4769

tests: test-archive.t use mercurial.util for urllib compat
author timeless <timeless@mozdev.org>
date Fri, 06 May 2016 19:24:25 +0000
parents 6c0b1d964537
children 09d0022cad83
files tests/test-archive.t
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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