1. Kirill Simonov
  2. pyyaml


Kirill Simonov  committed c4bc967

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

  • Participants
  • Parent commits 7854ec8
  • Branches default

Comments (0)

Files changed (1)

File setup.py

View file
  • Ignore whitespace
+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
     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):