Commits

Kirill Simonov committed c4bc967

Fixed the distutils script to run when installed using easy_install and Pyrex is available.

  • Participants
  • Parent commits 7854ec8

Comments (0)

Files changed (1)

 """
 
 
+import sys, os.path
+
 from distutils import log
 from distutils.core import setup, Command
 from distutils.core import Distribution as _Distribution
 from distutils.command.build_ext import build_ext as _build_ext
 from distutils.errors import CompileError, LinkError, DistutilsPlatformError
 
+if 'setuptools.extension' in sys.modules:
+    _Extension = sys.modules['setuptools.extension']._Extension
+    sys.modules['distutils.core'].Extension = _Extension
+    sys.modules['distutils.extension'].Extension = _Extension
+    sys.modules['distutils.command.build_ext'].Extension = _Extension
+
 try:
     from Pyrex.Distutils import Extension as _Extension
     from Pyrex.Distutils import build_ext as _build_ext
 except ImportError:
     with_pyrex = False
 
-import sys, os.path
 
 
 class Distribution(_Distribution):