]> granicus.if.org Git - python/commitdiff
fix test import for use in standalone pybsddb project bsddb3 module as well
authorGregory P. Smith <greg@mad-scientist.com>
Sun, 29 Jan 2006 23:54:38 +0000 (23:54 +0000)
committerGregory P. Smith <greg@mad-scientist.com>
Sun, 29 Jan 2006 23:54:38 +0000 (23:54 +0000)
as python builtin bsddb.

Lib/bsddb/test/test_1413192.py

index 45afb36f2432bad92e8f5965e56fa511eca73687..3c135365c954f42a593e621ae469d56f5d66dc71 100644 (file)
@@ -4,7 +4,12 @@
 # This test relies on the variable names, see the bug report for details.
 # The problem was that the env was deallocated prior to the txn.
 
-from bsddb import db
+try:
+    # For Pythons w/distutils and add-on pybsddb
+    from bsddb3 import db
+except ImportError:
+    # For Python >= 2.3 builtin bsddb distribution
+    from bsddb import db
 
 env_name = '.'