diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2013-06-19 11:45:38 +0100 |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2013-06-19 11:45:38 +0100 |
commit | 8d016844c5934fe8f7ee4c559ab5a1f2133fa6dc (patch) | |
tree | 199a8e4792f87c951fcf82197061c35e5805d100 /tests/test_ez_setup.py | |
parent | 744a61f18bbfcbf7dfaa08886185b4595d8b7bcb (diff) | |
parent | 5d9d3930f400a754f38be2a4de21a7f9ed00f5f4 (diff) | |
download | external_python_setuptools-8d016844c5934fe8f7ee4c559ab5a1f2133fa6dc.tar.gz external_python_setuptools-8d016844c5934fe8f7ee4c559ab5a1f2133fa6dc.tar.bz2 external_python_setuptools-8d016844c5934fe8f7ee4c559ab5a1f2133fa6dc.zip |
Merged upstream changes.
--HG--
branch : single-codebase
Diffstat (limited to 'tests/test_ez_setup.py')
-rw-r--r-- | tests/test_ez_setup.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/test_ez_setup.py b/tests/test_ez_setup.py index 6dd4c055..26881f52 100644 --- a/tests/test_ez_setup.py +++ b/tests/test_ez_setup.py @@ -16,7 +16,7 @@ import ez_setup class TestSetup(unittest.TestCase): def urlopen(self, url): - return open(self.tarball) + return open(self.tarball, 'rb') def setUp(self): self.old_sys_path = copy.copy(sys.path) @@ -27,10 +27,7 @@ class TestSetup(unittest.TestCase): "--dist-dir", "%s" % self.tmpdir) tarball = os.listdir(self.tmpdir)[0] self.tarball = os.path.join(self.tmpdir, tarball) - try: - import urllib2 - except ImportError: - import urllib.request as urllib2 + from setuptools.compat import urllib2 urllib2.urlopen = self.urlopen def tearDown(self): @@ -40,7 +37,7 @@ class TestSetup(unittest.TestCase): def test_build_egg(self): # making it an egg - egg = _build_egg(self.tarball, self.tmpdir) + egg = _build_egg('Egg to be built', self.tarball, self.tmpdir) # now trying to import it sys.path[0] = egg |