mirror of
https://github.com/python/cpython.git
synced 2025-11-08 21:52:45 +00:00
number of tests, all because of the codecs/_multibytecodecs issue described here (it's not a Py3K issue, just something Py3K discovers): http://mail.python.org/pipermail/python-dev/2006-April/064051.html Hye-Shik Chang promised to look for a fix, so no need to fix it here. The tests that are expected to break are: test_codecencodings_cn test_codecencodings_hk test_codecencodings_jp test_codecencodings_kr test_codecencodings_tw test_codecs test_multibytecodec This merge fixes an actual test failure (test_weakref) in this branch, though, so I believe merging is the right thing to do anyway.
35 lines
1.1 KiB
Python
35 lines
1.1 KiB
Python
from distutils.core import Extension as _Extension
|
|
from dist import _get_unpatched
|
|
_Extension = _get_unpatched(_Extension)
|
|
|
|
try:
|
|
from Pyrex.Distutils.build_ext import build_ext
|
|
except ImportError:
|
|
have_pyrex = False
|
|
else:
|
|
have_pyrex = True
|
|
|
|
|
|
class Extension(_Extension):
|
|
"""Extension that uses '.c' files in place of '.pyx' files"""
|
|
|
|
if not have_pyrex:
|
|
# convert .pyx extensions to .c
|
|
def __init__(self,*args,**kw):
|
|
_Extension.__init__(self,*args,**kw)
|
|
sources = []
|
|
for s in self.sources:
|
|
if s.endswith('.pyx'):
|
|
sources.append(s[:-3]+'c')
|
|
else:
|
|
sources.append(s)
|
|
self.sources = sources
|
|
|
|
class Library(Extension):
|
|
"""Just like a regular Extension, but built as a library instead"""
|
|
|
|
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
|