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=
# workaround for setuptools
if 'setuptools' in sys.modules:
Extension_dustutils = sys.modules['setuptools.extension']._Extension
Extension_setuptools = sys.modules['setuptools'].Extension
else:
# dummy class, in case we do not have setuptools
Extension_dustutils = Extension
class Extension_setuptools(Extension): pass
for pattern in patterns:
......@@ -665,7 +667,7 @@ def create_extension_list(patterns, exclude=None, ctx=None, aliases=None, quiet=
base = None
exn_type = Extension
ext_language = language
elif isinstance(pattern, (Extension, Extension_setuptools)):
elif isinstance(pattern, (Extension_dustutils, Extension_setuptools)):
for filepattern in pattern.sources:
if os.path.splitext(filepattern)[1] in ('.py', '.pyx'):
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