summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorINADA Naoki <inada-n@klab.com>2013-02-04 15:16:17 +0900
committerINADA Naoki <inada-n@klab.com>2013-02-04 15:16:17 +0900
commit6740b90385b2d8a23fe7ace6e9a69f62e7a0e14c (patch)
tree728d616ffb33a27ba00bd1a331d199f4434029b2 /setup.py
parent266eaf813d4e958dce5a2a8c4a84babf331369f0 (diff)
parenta865f8f7e94ea5b484771c1be3fe57ff3a63aa2a (diff)
downloadmsgpack-python-6740b90385b2d8a23fe7ace6e9a69f62e7a0e14c.tar.gz
Merge branch 'purepython'
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py32
1 files changed, 19 insertions, 13 deletions
diff --git a/setup.py b/setup.py
index d4808d6..1055a61 100644
--- a/setup.py
+++ b/setup.py
@@ -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