Everything worked in both the distutils distro and in Python 2.3cvs,
so merge from the bsddb-bsddb3-schizo-branch back to the trunk.
diff --git a/Lib/bsddb/test/test_all.py b/Lib/bsddb/test/test_all.py
index 15b310f..358f5d1 100644
--- a/Lib/bsddb/test/test_all.py
+++ b/Lib/bsddb/test/test_all.py
@@ -16,7 +16,12 @@
def print_versions():
- from bsddb import db
+ try:
+ # For Python 2.3
+ from bsddb import db
+ except ImportError:
+ # For earlier Pythons w/distutils pybsddb
+ from bsddb3 import db
print
print '-=' * 38
print db.DB_VERSION_STRING
diff --git a/Lib/bsddb/test/test_associate.py b/Lib/bsddb/test/test_associate.py
index 7f1df83..3061e45 100644
--- a/Lib/bsddb/test/test_associate.py
+++ b/Lib/bsddb/test/test_associate.py
@@ -16,7 +16,12 @@
import unittest
from test_all import verbose
-from bsddb import db, dbshelve
+try:
+ # For Python 2.3
+ from bsddb import db, dbshelve
+except ImportError:
+ # For earlier Pythons w/distutils pybsddb
+ from bsddb3 import db, dbshelve
#----------------------------------------------------------------------
diff --git a/Lib/bsddb/test/test_basics.py b/Lib/bsddb/test/test_basics.py
index 25cc77c..224aef4 100644
--- a/Lib/bsddb/test/test_basics.py
+++ b/Lib/bsddb/test/test_basics.py
@@ -12,7 +12,12 @@
from pprint import pprint
import unittest
-from bsddb import db
+try:
+ # For Python 2.3
+ from bsddb import db
+except ImportError:
+ # For earlier Pythons w/distutils pybsddb
+ from bsddb3 import db
from test_all import verbose
diff --git a/Lib/bsddb/test/test_compat.py b/Lib/bsddb/test/test_compat.py
index 862ec74..26b80cf0 100644
--- a/Lib/bsddb/test/test_compat.py
+++ b/Lib/bsddb/test/test_compat.py
@@ -4,13 +4,18 @@
"""
import sys, os, string
-from bsddb import hashopen, btopen, rnopen
import bsddb
import unittest
import tempfile
from test_all import verbose
+try:
+ # For Python 2.3
+ from bsddb import db, hashopen, btopen, rnopen
+except ImportError:
+ # For earlier Pythons w/distutils pybsddb
+ from bsddb3 import db, hashopen, btopen, rnopen
class CompatibilityTestCase(unittest.TestCase):
@@ -126,7 +131,7 @@
if verbose: print "truth test: true"
else:
if verbose: print "truth test: false"
- except bsddb.error:
+ except db.DBError:
pass
else:
self.fail("Exception expected")
diff --git a/Lib/bsddb/test/test_dbobj.py b/Lib/bsddb/test/test_dbobj.py
index 1e1ac27..93ea7ba 100644
--- a/Lib/bsddb/test/test_dbobj.py
+++ b/Lib/bsddb/test/test_dbobj.py
@@ -3,7 +3,12 @@
import unittest
import glob
-from bsddb import db, dbobj
+try:
+ # For Python 2.3
+ from bsddb import db, dbobj
+except ImportError:
+ # For earlier Pythons w/distutils pybsddb
+ from bsddb3 import db, dbobj
#----------------------------------------------------------------------
diff --git a/Lib/bsddb/test/test_dbshelve.py b/Lib/bsddb/test/test_dbshelve.py
index 900ec8e..7491cb7 100644
--- a/Lib/bsddb/test/test_dbshelve.py
+++ b/Lib/bsddb/test/test_dbshelve.py
@@ -8,7 +8,12 @@
from types import *
import unittest
-from bsddb import dbshelve, db
+try:
+ # For Python 2.3
+ from bsddb import db, dbshelve
+except ImportError:
+ # For earlier Pythons w/distutils pybsddb
+ from bsddb3 import db, dbshelve
from test_all import verbose
diff --git a/Lib/bsddb/test/test_dbtables.py b/Lib/bsddb/test/test_dbtables.py
index a250cf8..685b08d 100644
--- a/Lib/bsddb/test/test_dbtables.py
+++ b/Lib/bsddb/test/test_dbtables.py
@@ -30,7 +30,12 @@
import unittest
from test_all import verbose
-from bsddb import db, dbtables
+try:
+ # For Python 2.3
+ from bsddb import db, dbtables
+except ImportError:
+ # For earlier Pythons w/distutils pybsddb
+ from bsddb3 import db, dbtables
diff --git a/Lib/bsddb/test/test_env_close.py b/Lib/bsddb/test/test_env_close.py
index 0b46ee3..105be44 100644
--- a/Lib/bsddb/test/test_env_close.py
+++ b/Lib/bsddb/test/test_env_close.py
@@ -8,7 +8,12 @@
import glob
import unittest
-from bsddb import db
+try:
+ # For Python 2.3
+ from bsddb import db
+except ImportError:
+ # For earlier Pythons w/distutils pybsddb
+ from bsddb3 import db
from test_all import verbose
diff --git a/Lib/bsddb/test/test_get_none.py b/Lib/bsddb/test/test_get_none.py
index 211717b..40b224e 100644
--- a/Lib/bsddb/test/test_get_none.py
+++ b/Lib/bsddb/test/test_get_none.py
@@ -7,7 +7,12 @@
from pprint import pprint
import unittest
-from bsddb import db
+try:
+ # For Python 2.3
+ from bsddb import db
+except ImportError:
+ # For earlier Pythons w/distutils pybsddb
+ from bsddb3 import db
from test_all import verbose
diff --git a/Lib/bsddb/test/test_lock.py b/Lib/bsddb/test/test_lock.py
index 337a898..af10bea 100644
--- a/Lib/bsddb/test/test_lock.py
+++ b/Lib/bsddb/test/test_lock.py
@@ -18,7 +18,12 @@
import unittest
from test_all import verbose
-from bsddb import db
+try:
+ # For Python 2.3
+ from bsddb import db
+except ImportError:
+ # For earlier Pythons w/distutils pybsddb
+ from bsddb3 import db
#----------------------------------------------------------------------
diff --git a/Lib/bsddb/test/test_misc.py b/Lib/bsddb/test/test_misc.py
index 24c3fc6..7f7a6ee 100644
--- a/Lib/bsddb/test/test_misc.py
+++ b/Lib/bsddb/test/test_misc.py
@@ -5,8 +5,12 @@
import sys
import unittest
-from bsddb import db
-from bsddb import dbshelve
+try:
+ # For Python 2.3
+ from bsddb import db, dbshelve
+except ImportError:
+ # For earlier Pythons w/distutils pybsddb
+ from bsddb3 import db, dbshelve
from test.test_support import verbose
diff --git a/Lib/bsddb/test/test_queue.py b/Lib/bsddb/test/test_queue.py
index e651193..24b86cb 100644
--- a/Lib/bsddb/test/test_queue.py
+++ b/Lib/bsddb/test/test_queue.py
@@ -7,7 +7,12 @@
from pprint import pprint
import unittest
-from bsddb import db
+try:
+ # For Python 2.3
+ from bsddb import db
+except ImportError:
+ # For earlier Pythons w/distutils pybsddb
+ from bsddb3 import db
from test_all import verbose
diff --git a/Lib/bsddb/test/test_recno.py b/Lib/bsddb/test/test_recno.py
index ffdb76b..3e517c1 100644
--- a/Lib/bsddb/test/test_recno.py
+++ b/Lib/bsddb/test/test_recno.py
@@ -8,9 +8,15 @@
from pprint import pprint
import unittest
-from bsddb import db
from test_all import verbose
+try:
+ # For Python 2.3
+ from bsddb import db
+except ImportError:
+ # For earlier Pythons w/distutils pybsddb
+ from bsddb3 import db
+
letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
diff --git a/Lib/bsddb/test/test_thread.py b/Lib/bsddb/test/test_thread.py
index 14f8d26..48e8c9a 100644
--- a/Lib/bsddb/test/test_thread.py
+++ b/Lib/bsddb/test/test_thread.py
@@ -26,7 +26,14 @@
import unittest
from test_all import verbose
-from bsddb import db, dbutils
+
+try:
+ # For Python 2.3
+ from bsddb import db, dbutils
+except ImportError:
+ # For earlier Pythons w/distutils pybsddb
+ from bsddb3 import db, dbutils
+
#----------------------------------------------------------------------