summaryrefslogtreecommitdiff
path: root/setuptools/extension.py
diff options
context:
space:
mode:
Diffstat (limited to 'setuptools/extension.py')
-rw-r--r--setuptools/extension.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/setuptools/extension.py b/setuptools/extension.py
index 55a4d946..37b62576 100644
--- a/setuptools/extension.py
+++ b/setuptools/extension.py
@@ -7,6 +7,9 @@ except ImportError:
# Pyrex isn't around, so fix up the sources
+ from dist import _get_unpatched
+ _Extension = _get_unpatched(_Extension)
+
class Extension(_Extension):
"""Extension that uses '.c' files in place of '.pyx' files"""
@@ -21,7 +24,14 @@ except ImportError:
sources.append(s)
self.sources = sources
+ import sys, distutils.core, distutils.extension
+ distutils.core.Extension = Extension
+ distutils.extension.Extension = Extension
+ if 'distutils.command.build_ext' in sys.modules:
+ sys.modules['distutils.command.build_ext'].Extension = Extension
+
else:
# Pyrex is here, just use regular extension type
Extension = _Extension
+