[Zodb-checkins] CVS: ZODB3/bsddb3Storage - setup.py:1.11

Barry Warsaw barry@wooz.org
Thu, 21 Nov 2002 14:48:21 -0500


Update of /cvs-repository/ZODB3/bsddb3Storage
In directory cvs.zope.org:/tmp/cvs-serv5310

Modified Files:
	setup.py 
Log Message:
Don't try to build the _helper extension when using Python < 2.2,
since it's not compatible with earlier Python's.  That's ok, because
the storages have pure-Python workarounds, but distutils doesn't know
how to cope with the #error that the compilation will throw.


=== ZODB3/bsddb3Storage/setup.py 1.10 => 1.11 ===
--- ZODB3/bsddb3Storage/setup.py:1.10	Mon Nov 11 17:15:16 2002
+++ ZODB3/bsddb3Storage/setup.py	Thu Nov 21 14:48:21 2002
@@ -7,8 +7,17 @@
 #
 # % python setup.py install
 
-from bsddb3Storage import __version__
+import sys
 from distutils.core import setup, Extension
+from bsddb3Storage import __version__
+
+# The _helper module is not compatible with anything before Python 2.2.  The
+# storages have Python equivalents, but this just prevents "setup.py build"
+# from complaining and stopping.
+if sys.hexversion >= 0x02020000:
+    ext_modules = [Extension('_helper', ['bsddb3Storage/_helper.c'])]
+else:
+    ext_modules = None
 
 setup(name='bsddb3Storage',
       version=__version__,
@@ -17,5 +26,5 @@
       author_email='zodb-dev@zope.org',
       url='http://www.zope.org/Wikis/ZODB/BerkeleyStorage',
       packages=['bsddb3Storage', 'bsddb3Storage.tests'],
-      ext_modules=[Extension('_helper', ['bsddb3Storage/_helper.c'])],
+      ext_modules=ext_modules,
       )