diff options
| author | INADA Naoki <songofacandy@gmail.com> | 2013-02-03 08:11:34 -0800 |
|---|---|---|
| committer | INADA Naoki <songofacandy@gmail.com> | 2013-02-03 08:11:34 -0800 |
| commit | 2330e6c7d92455c84fef4b7f9ac44b2a8b430def (patch) | |
| tree | c4a2a3ba74d4f5788b8dd507553f23b8d2ff2519 /setup.py | |
| parent | 266eaf813d4e958dce5a2a8c4a84babf331369f0 (diff) | |
| parent | 1951b197b547c3f12b755790717d799272fbeb34 (diff) | |
| download | msgpack-python-2330e6c7d92455c84fef4b7f9ac44b2a8b430def.tar.gz | |
Merge pull request #45 from msgpack/purepython
fallback enhancements.
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 |
