diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2014-05-17 12:25:31 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2014-05-17 12:25:31 -0400 |
commit | 8567ca65adbf927a0af5c9b7314688dfbc46ab66 (patch) | |
tree | 345ee8e9d0eaa61a64786215cf6bda53abd5b5e5 /setuptools/command/test.py | |
parent | 3c85da71f22c43041e7475b01b4683f22fc3a618 (diff) | |
download | external_python_setuptools-8567ca65adbf927a0af5c9b7314688dfbc46ab66.tar.gz external_python_setuptools-8567ca65adbf927a0af5c9b7314688dfbc46ab66.tar.bz2 external_python_setuptools-8567ca65adbf927a0af5c9b7314688dfbc46ab66.zip |
Use PY3 and PY2 throughout
Diffstat (limited to 'setuptools/command/test.py')
-rw-r--r-- | setuptools/command/test.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/setuptools/command/test.py b/setuptools/command/test.py index 7422b719..3c3581a9 100644 --- a/setuptools/command/test.py +++ b/setuptools/command/test.py @@ -8,6 +8,7 @@ from pkg_resources import (resource_listdir, resource_exists, normalize_path, working_set, _namespace_packages, add_activation_listener, require, EntryPoint) +from setuptools.compat import PY3 from setuptools.py31compat import unittest_main @@ -87,10 +88,8 @@ class test(Command): self.test_runner = getattr(self.distribution, 'test_runner', None) def with_project_on_sys_path(self, func): - with_2to3 = ( - sys.version_info >= (3,) - and getattr(self.distribution, 'use_2to3', False) - ) + with_2to3 = PY3 and getattr(self.distribution, 'use_2to3', False) + if with_2to3: # If we run 2to3 we can not do this inplace: @@ -149,7 +148,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 sys.version_info >= (3,) and getattr(self.distribution, 'use_2to3', False): + if PY3 and getattr(self.distribution, 'use_2to3', False): module = self.test_args[-1].split('.')[0] if module in _namespace_packages: del_modules = [] |