Fix building universal wheels on Python 3.
Building a wheel on Python 3 was missing ``_compat2x.py`` needed for Python2.
This was a side effect of the fix to bug #941958, where we fixed a cosmetic
error. (Robert Collins, #1430534)
This reverts commit 56c49a5fd4.
Change-Id: I4de72a62b5ddf7349c432165f796841a0998e878
This commit is contained in:
7
NEWS
7
NEWS
@@ -7,6 +7,13 @@ Changes and improvements to testtools_, grouped by release.
|
||||
NEXT
|
||||
~~~~
|
||||
|
||||
Improvements
|
||||
------------
|
||||
|
||||
* Building a wheel on Python 3 was missing ``_compat2x.py`` needed for Python2.
|
||||
This was a side effect of the fix to bug #941958, where we fixed a cosmetic
|
||||
error. (Robert Collins, #1430534)
|
||||
|
||||
1.7.0
|
||||
~~~~~
|
||||
|
||||
|
||||
10
setup.py
10
setup.py
@@ -2,10 +2,8 @@
|
||||
"""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 = {}
|
||||
@@ -13,14 +11,6 @@ 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')
|
||||
|
||||
@@ -34,7 +34,7 @@ linecache = try_import('linecache2')
|
||||
|
||||
try:
|
||||
from testtools import _compat2x as _compat
|
||||
except (SyntaxError, ImportError):
|
||||
except SyntaxError:
|
||||
from testtools import _compat3x as _compat
|
||||
|
||||
reraise = _compat.reraise
|
||||
|
||||
Reference in New Issue
Block a user