summaryrefslogtreecommitdiffstats
path: root/Lib/bsddb/test/test_env_close.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/bsddb/test/test_env_close.py')
-rw-r--r--Lib/bsddb/test/test_env_close.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/bsddb/test/test_env_close.py b/Lib/bsddb/test/test_env_close.py
index 2ef5867..fa3adad 100644
--- a/Lib/bsddb/test/test_env_close.py
+++ b/Lib/bsddb/test/test_env_close.py
@@ -6,7 +6,6 @@ import os
import shutil
import sys
import tempfile
-import glob
import unittest
try:
@@ -34,15 +33,16 @@ else:
class DBEnvClosedEarlyCrash(unittest.TestCase):
def setUp(self):
- self.homeDir = tempfile.mkdtemp()
- old_tempfile_tempdir = tempfile.tempdir
+ self.homeDir = os.path.join(tempfile.gettempdir(), 'db_home%d'%os.getpid())
+ try: os.mkdir(self.homeDir)
+ except os.error: pass
tempfile.tempdir = self.homeDir
self.filename = os.path.split(tempfile.mktemp())[1]
- tempfile.tempdir = old_tempfile_tempdir
+ tempfile.tempdir = None
def tearDown(self):
- shutil.rmtree(self.homeDir)
-
+ from test import test_support
+ test_support.rmtree(self.homeDir)
def test01_close_dbenv_before_db(self):
dbenv = db.DBEnv()