diff options
author | INADA Naoki <inada-n@klab.com> | 2013-02-04 15:16:17 +0900 |
---|---|---|
committer | INADA Naoki <inada-n@klab.com> | 2013-02-04 15:16:17 +0900 |
commit | 6740b90385b2d8a23fe7ace6e9a69f62e7a0e14c (patch) | |
tree | 728d616ffb33a27ba00bd1a331d199f4434029b2 /setup.py | |
parent | 266eaf813d4e958dce5a2a8c4a84babf331369f0 (diff) | |
parent | a865f8f7e94ea5b484771c1be3fe57ff3a63aa2a (diff) | |
download | msgpack-python-6740b90385b2d8a23fe7ace6e9a69f62e7a0e14c.tar.gz |
Merge branch 'purepython'
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 32 |
1 files changed, 19 insertions, 13 deletions
@@ -46,7 +46,12 @@ class BuildExt(build_ext): print("Install Cython >= 0.16 or install msgpack from PyPI.") print("Falling back to pure Python implementation.") return - return build_ext.build_extension(self, ext) + try: + return build_ext.build_extension(self, ext) + except Exception as e: + print("WARNING: Failed to compile extensiom modules.") + print("msgpack uses fallback pure python implementation.") + print(e) exec(open('msgpack/_version.py').read()) @@ -75,18 +80,19 @@ else: macros = [('__LITTLE_ENDIAN__', '1')] ext_modules = [] -ext_modules.append(Extension('msgpack._packer', - sources=['msgpack/_packer.cpp'], - libraries=libraries, - include_dirs=['.'], - define_macros=macros, - )) -ext_modules.append(Extension('msgpack._unpacker', - sources=['msgpack/_unpacker.cpp'], - libraries=libraries, - include_dirs=['.'], - define_macros=macros, - )) +if not hasattr(sys, 'pypy_version_info'): + ext_modules.append(Extension('msgpack._packer', + sources=['msgpack/_packer.cpp'], + libraries=libraries, + include_dirs=['.'], + define_macros=macros, + )) + ext_modules.append(Extension('msgpack._unpacker', + sources=['msgpack/_unpacker.cpp'], + libraries=libraries, + include_dirs=['.'], + define_macros=macros, + )) del libraries, macros |