diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2014-07-05 15:06:51 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2014-07-05 15:06:51 -0400 |
commit | b49435397a5094f94678adf3549cc8941aa469b7 (patch) | |
tree | b123bdd63482393ba1e2859364920f40a3d9f71d /setuptools/tests/test_test.py | |
parent | 5b865b1b6e23379d23aa80e74adb38db8b14b6ca (diff) | |
download | python-setuptools-git-b49435397a5094f94678adf3549cc8941aa469b7.tar.gz |
Use six for Python 2 compatibility
--HG--
branch : feature/issue-229
extra : source : 7b1997ececc5772798ce33a0f8e77387cb55a977
Diffstat (limited to 'setuptools/tests/test_test.py')
-rw-r--r-- | setuptools/tests/test_test.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/setuptools/tests/test_test.py b/setuptools/tests/test_test.py index df92085e..67df14e5 100644 --- a/setuptools/tests/test_test.py +++ b/setuptools/tests/test_test.py @@ -8,9 +8,10 @@ import site import sys import tempfile import unittest - from distutils.errors import DistutilsError -from setuptools.compat import StringIO, PY2 + +import six + from setuptools.command.test import test from setuptools.command import easy_install as easy_install_pkg from setuptools.dist import Distribution @@ -34,7 +35,7 @@ except ImportError: __path__ = extend_path(__path__, __name__) """ # Make sure this is Latin-1 binary, before writing: -if PY2: +if six.PY2: NS_INIT = NS_INIT.decode('UTF-8') NS_INIT = NS_INIT.encode('Latin-1') @@ -115,7 +116,7 @@ class TestTestTest(unittest.TestCase): cmd.install_dir = site.USER_SITE cmd.user = 1 old_stdout = sys.stdout - sys.stdout = StringIO() + sys.stdout = six.StringIO() try: try: # try/except/finally doesn't work in Python 2.4, so we need nested try-statements. cmd.run() |