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/command/test.py | |
parent | 5b865b1b6e23379d23aa80e74adb38db8b14b6ca (diff) | |
download | external_python_setuptools-b49435397a5094f94678adf3549cc8941aa469b7.tar.gz external_python_setuptools-b49435397a5094f94678adf3549cc8941aa469b7.tar.bz2 external_python_setuptools-b49435397a5094f94678adf3549cc8941aa469b7.zip |
Use six for Python 2 compatibility
--HG--
branch : feature/issue-229
extra : source : 7b1997ececc5772798ce33a0f8e77387cb55a977
Diffstat (limited to 'setuptools/command/test.py')
-rw-r--r-- | setuptools/command/test.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/setuptools/command/test.py b/setuptools/command/test.py index 1038da71..14dd2600 100644 --- a/setuptools/command/test.py +++ b/setuptools/command/test.py @@ -3,11 +3,12 @@ from unittest import TestLoader import unittest import sys +import six + from pkg_resources import (resource_listdir, resource_exists, normalize_path, working_set, _namespace_packages, add_activation_listener, require, EntryPoint) from setuptools import Command -from setuptools.compat import PY3 from setuptools.py31compat import unittest_main @@ -84,7 +85,7 @@ class test(Command): self.test_runner = getattr(self.distribution, 'test_runner', None) def with_project_on_sys_path(self, func): - with_2to3 = PY3 and getattr(self.distribution, 'use_2to3', False) + with_2to3 = six.PY3 and getattr(self.distribution, 'use_2to3', False) if with_2to3: # If we run 2to3 we can not do this inplace: @@ -145,7 +146,7 @@ class test(Command): # Purge modules under test from sys.modules. The test loader will # re-import them from the build location. Required when 2to3 is used # with namespace packages. - if PY3 and getattr(self.distribution, 'use_2to3', False): + if six.PY3 and getattr(self.distribution, 'use_2to3', False): module = self.test_args[-1].split('.')[0] if module in _namespace_packages: del_modules = [] |