diff options
Diffstat (limited to 'Lib/bsddb')
-rw-r--r-- | Lib/bsddb/dbobj.py | 5 | ||||
-rw-r--r-- | Lib/bsddb/test/test_1413192.py | 2 | ||||
-rw-r--r-- | Lib/bsddb/test/test_associate.py | 2 | ||||
-rw-r--r-- | Lib/bsddb/test/test_basics.py | 2 | ||||
-rw-r--r-- | Lib/bsddb/test/test_dbobj.py | 3 | ||||
-rw-r--r-- | Lib/bsddb/test/test_dbshelve.py | 2 | ||||
-rw-r--r-- | Lib/bsddb/test/test_dbtables.py | 3 | ||||
-rw-r--r-- | Lib/bsddb/test/test_env_close.py | 2 | ||||
-rw-r--r-- | Lib/bsddb/test/test_join.py | 2 | ||||
-rw-r--r-- | Lib/bsddb/test/test_lock.py | 2 | ||||
-rw-r--r-- | Lib/bsddb/test/test_misc.py | 3 | ||||
-rw-r--r-- | Lib/bsddb/test/test_recno.py | 8 | ||||
-rw-r--r-- | Lib/bsddb/test/test_thread.py | 2 |
13 files changed, 21 insertions, 17 deletions
diff --git a/Lib/bsddb/dbobj.py b/Lib/bsddb/dbobj.py index 346c1adc6f..987f7735f5 100644 --- a/Lib/bsddb/dbobj.py +++ b/Lib/bsddb/dbobj.py @@ -55,8 +55,9 @@ class DBEnv: return self._cobj.set_lg_max(*args, **kwargs) def set_lk_detect(self, *args, **kwargs): return self._cobj.set_lk_detect(*args, **kwargs) - def set_lk_max(self, *args, **kwargs): - return self._cobj.set_lk_max(*args, **kwargs) + if db.version() < (4,5): + def set_lk_max(self, *args, **kwargs): + return self._cobj.set_lk_max(*args, **kwargs) def set_lk_max_locks(self, *args, **kwargs): return self._cobj.set_lk_max_locks(*args, **kwargs) def set_lk_max_lockers(self, *args, **kwargs): diff --git a/Lib/bsddb/test/test_1413192.py b/Lib/bsddb/test/test_1413192.py index 3c135365c9..436f407867 100644 --- a/Lib/bsddb/test/test_1413192.py +++ b/Lib/bsddb/test/test_1413192.py @@ -14,7 +14,7 @@ except ImportError: env_name = '.' env = db.DBEnv() -env.open(env_name, db.DB_CREATE | db.DB_INIT_TXN) +env.open(env_name, db.DB_CREATE | db.DB_INIT_TXN | db.DB_INIT_MPOOL) the_txn = env.txn_begin() map = db.DB(env) diff --git a/Lib/bsddb/test/test_associate.py b/Lib/bsddb/test/test_associate.py index 33a7837245..7ae7c53ff8 100644 --- a/Lib/bsddb/test/test_associate.py +++ b/Lib/bsddb/test/test_associate.py @@ -91,7 +91,7 @@ musicdata = { class AssociateErrorTestCase(unittest.TestCase): def setUp(self): self.filename = self.__class__.__name__ + '.db' - homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home') + homeDir = os.path.join(tempfile.gettempdir(), 'db_home') self.homeDir = homeDir try: os.mkdir(homeDir) diff --git a/Lib/bsddb/test/test_basics.py b/Lib/bsddb/test/test_basics.py index e0452df92f..48ecdb95c8 100644 --- a/Lib/bsddb/test/test_basics.py +++ b/Lib/bsddb/test/test_basics.py @@ -54,7 +54,7 @@ class BasicTestCase(unittest.TestCase): def setUp(self): if self.useEnv: - homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home') + homeDir = os.path.join(tempfile.gettempdir(), 'db_home') self.homeDir = homeDir try: shutil.rmtree(homeDir) diff --git a/Lib/bsddb/test/test_dbobj.py b/Lib/bsddb/test/test_dbobj.py index bba6a5b6a1..b15de2f0ef 100644 --- a/Lib/bsddb/test/test_dbobj.py +++ b/Lib/bsddb/test/test_dbobj.py @@ -2,6 +2,7 @@ import sys, os, string import unittest import glob +import tempfile try: # For Pythons w/distutils pybsddb @@ -19,7 +20,7 @@ class dbobjTestCase(unittest.TestCase): db_name = 'test-dbobj.db' def setUp(self): - homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home') + homeDir = os.path.join(tempfile.gettempdir(), 'db_home') self.homeDir = homeDir try: os.mkdir(homeDir) except os.error: pass diff --git a/Lib/bsddb/test/test_dbshelve.py b/Lib/bsddb/test/test_dbshelve.py index 374ccd8c60..1da6546a55 100644 --- a/Lib/bsddb/test/test_dbshelve.py +++ b/Lib/bsddb/test/test_dbshelve.py @@ -242,7 +242,7 @@ class ThreadHashShelveTestCase(BasicShelveTestCase): class BasicEnvShelveTestCase(DBShelveTestCase): def do_open(self): self.homeDir = homeDir = os.path.join( - os.path.dirname(sys.argv[0]), 'db_home') + tempfile.gettempdir(), 'db_home') try: os.mkdir(homeDir) except os.error: pass self.env = db.DBEnv() diff --git a/Lib/bsddb/test/test_dbtables.py b/Lib/bsddb/test/test_dbtables.py index 2ff93a3ef1..a31fcec910 100644 --- a/Lib/bsddb/test/test_dbtables.py +++ b/Lib/bsddb/test/test_dbtables.py @@ -26,6 +26,7 @@ try: pickle = cPickle except ImportError: import pickle +import tempfile import unittest from .test_all import verbose @@ -46,7 +47,7 @@ class TableDBTestCase(unittest.TestCase): db_name = 'test-table.db' def setUp(self): - homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home') + homeDir = os.path.join(tempfile.gettempdir(), 'db_home') self.homeDir = homeDir try: os.mkdir(homeDir) except os.error: pass diff --git a/Lib/bsddb/test/test_env_close.py b/Lib/bsddb/test/test_env_close.py index 43dcabe92b..12e103746a 100644 --- a/Lib/bsddb/test/test_env_close.py +++ b/Lib/bsddb/test/test_env_close.py @@ -33,7 +33,7 @@ else: class DBEnvClosedEarlyCrash(unittest.TestCase): def setUp(self): - self.homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home') + self.homeDir = os.path.join(tempfile.gettempdir(), 'db_home') try: os.mkdir(self.homeDir) except os.error: pass tempfile.tempdir = self.homeDir diff --git a/Lib/bsddb/test/test_join.py b/Lib/bsddb/test/test_join.py index 6e98b0b621..5e307aead7 100644 --- a/Lib/bsddb/test/test_join.py +++ b/Lib/bsddb/test/test_join.py @@ -49,7 +49,7 @@ class JoinTestCase(unittest.TestCase): def setUp(self): self.filename = self.__class__.__name__ + '.db' - homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home') + homeDir = os.path.join(tempfile.gettempdir(), 'db_home') self.homeDir = homeDir try: os.mkdir(homeDir) except os.error: pass diff --git a/Lib/bsddb/test/test_lock.py b/Lib/bsddb/test/test_lock.py index 53f11a82ff..61bdae8b76 100644 --- a/Lib/bsddb/test/test_lock.py +++ b/Lib/bsddb/test/test_lock.py @@ -30,7 +30,7 @@ except ImportError: class LockingTestCase(unittest.TestCase): def setUp(self): - homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home') + homeDir = os.path.join(tempfile.gettempdir(), 'db_home') self.homeDir = homeDir try: os.mkdir(homeDir) except os.error: pass diff --git a/Lib/bsddb/test/test_misc.py b/Lib/bsddb/test/test_misc.py index 88f700b469..6b2df073c9 100644 --- a/Lib/bsddb/test/test_misc.py +++ b/Lib/bsddb/test/test_misc.py @@ -4,6 +4,7 @@ import os import sys import unittest +import tempfile try: # For Pythons w/distutils pybsddb @@ -17,7 +18,7 @@ except ImportError: class MiscTestCase(unittest.TestCase): def setUp(self): self.filename = self.__class__.__name__ + '.db' - homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home') + homeDir = os.path.join(tempfile.gettempdir(), 'db_home') self.homeDir = homeDir try: os.mkdir(homeDir) diff --git a/Lib/bsddb/test/test_recno.py b/Lib/bsddb/test/test_recno.py index e325aac89a..35399b517b 100644 --- a/Lib/bsddb/test/test_recno.py +++ b/Lib/bsddb/test/test_recno.py @@ -203,10 +203,10 @@ class SimpleRecnoTestCase(unittest.TestCase): just a line in the file, but you can set a different record delimiter if needed. """ - source = os.path.join(os.path.dirname(sys.argv[0]), - 'db_home/test_recno.txt') - if not os.path.isdir('db_home'): - os.mkdir('db_home') + homeDir = os.path.join(tempfile.gettempdir(), 'db_home') + source = os.path.join(homeDir, 'test_recno.txt') + if not os.path.isdir(homeDir): + os.mkdir(homeDir) f = open(source, 'w') # create the file f.close() diff --git a/Lib/bsddb/test/test_thread.py b/Lib/bsddb/test/test_thread.py index 6942aa222c..bf19d21e6d 100644 --- a/Lib/bsddb/test/test_thread.py +++ b/Lib/bsddb/test/test_thread.py @@ -53,7 +53,7 @@ class BaseThreadedTestCase(unittest.TestCase): if verbose: dbutils._deadlock_VerboseFile = sys.stdout - homeDir = os.path.join(os.path.dirname(sys.argv[0]), 'db_home') + homeDir = os.path.join(tempfile.gettempdir(), 'db_home') self.homeDir = homeDir try: os.mkdir(homeDir) |