diff options
author | Hugo <hugovk@users.noreply.github.com> | 2020-01-08 19:10:11 +0200 |
---|---|---|
committer | Hugo <hugovk@users.noreply.github.com> | 2020-01-08 19:10:11 +0200 |
commit | 796abd8dbec884cedf326cb5f85512a5d5648c4e (patch) | |
tree | cacbbdc28822b519f87b679a8262687421d13c01 /setuptools/command/test.py | |
parent | 7e97def47723303fafabe48b22168bbc11bb4821 (diff) | |
download | python-setuptools-git-796abd8dbec884cedf326cb5f85512a5d5648c4e.tar.gz |
Fix for Python 4: replace unsafe six.PY3 with PY2
Diffstat (limited to 'setuptools/command/test.py')
-rw-r--r-- | setuptools/command/test.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/setuptools/command/test.py b/setuptools/command/test.py index c148b38d..f6470e9c 100644 --- a/setuptools/command/test.py +++ b/setuptools/command/test.py @@ -129,7 +129,7 @@ class test(Command): @contextlib.contextmanager def project_on_sys_path(self, include_dists=[]): - with_2to3 = six.PY3 and getattr(self.distribution, 'use_2to3', False) + with_2to3 = not six.PY2 and getattr(self.distribution, 'use_2to3', False) if with_2to3: # If we run 2to3 we can not do this inplace: @@ -240,7 +240,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 six.PY3 and getattr(self.distribution, 'use_2to3', False): + if not six.PY2 and getattr(self.distribution, 'use_2to3', False): module = self.test_suite.split('.')[0] if module in _namespace_packages: del_modules = [] |