Commit d804bd2d authored by Robert Bradshaw's avatar Robert Bradshaw

Allow mixing of setuptools and distutils Extension classes.

parent 7c8b08e0
...@@ -652,9 +652,11 @@ def create_extension_list(patterns, exclude=None, ctx=None, aliases=None, quiet= ...@@ -652,9 +652,11 @@ def create_extension_list(patterns, exclude=None, ctx=None, aliases=None, quiet=
# workaround for setuptools # workaround for setuptools
if 'setuptools' in sys.modules: if 'setuptools' in sys.modules:
Extension_dustutils = sys.modules['setuptools.extension']._Extension
Extension_setuptools = sys.modules['setuptools'].Extension Extension_setuptools = sys.modules['setuptools'].Extension
else: else:
# dummy class, in case we do not have setuptools # dummy class, in case we do not have setuptools
Extension_dustutils = Extension
class Extension_setuptools(Extension): pass class Extension_setuptools(Extension): pass
for pattern in patterns: for pattern in patterns:
...@@ -665,7 +667,7 @@ def create_extension_list(patterns, exclude=None, ctx=None, aliases=None, quiet= ...@@ -665,7 +667,7 @@ def create_extension_list(patterns, exclude=None, ctx=None, aliases=None, quiet=
base = None base = None
exn_type = Extension exn_type = Extension
ext_language = language ext_language = language
elif isinstance(pattern, (Extension, Extension_setuptools)): elif isinstance(pattern, (Extension_dustutils, Extension_setuptools)):
for filepattern in pattern.sources: for filepattern in pattern.sources:
if os.path.splitext(filepattern)[1] in ('.py', '.pyx'): if os.path.splitext(filepattern)[1] in ('.py', '.pyx'):
break break
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment