diff options
author | wbond <will@wbond.net> | 2013-03-18 19:43:19 +1300 |
---|---|---|
committer | Robert Collins <robertc@robertcollins.net> | 2013-03-18 19:47:25 +1300 |
commit | 56c49a5fd420143627e50e2d0ec86e1f37075875 (patch) | |
tree | 5275ac9d213029f460b8418ad4c00014928d1ca7 /setup.py | |
parent | e7ac371211442024a6429f343df3b0876cae073b (diff) | |
download | testtools-56c49a5fd420143627e50e2d0ec86e1f37075875.tar.gz |
Fixed SyntaxError when installing via Python 3
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -2,8 +2,10 @@ """Distutils installer for testtools.""" from setuptools import setup +from distutils.command.build_py import build_py import email import os +import sys import testtools cmd_class = {} @@ -11,6 +13,14 @@ if getattr(testtools, 'TestCommand', None) is not None: cmd_class['test'] = testtools.TestCommand +class testtools_build_py(build_py): + def build_module(self, module, module_file, package): + if sys.version_info >= (3,) and module == '_compat2x': + return + return build_py.build_module(self, module, module_file, package) +cmd_class['build_py'] = testtools_build_py + + def get_version_from_pkg_info(): """Get the version from PKG-INFO file if we can.""" pkg_info_path = os.path.join(os.path.dirname(__file__), 'PKG-INFO') |