Handle ERROR_ALREADY_EXISTS.

This commit is contained in:
Martin v. Löwis 2006-05-06 20:04:08 +00:00
parent d4e3bb3d39
commit e93abb7ca6
1 changed files with 8 additions and 0 deletions

View File

@ -24,6 +24,12 @@ try:
except ImportError:
have_threads = False
try:
WindowsError
except NameError:
class WindowsError(Exception):
pass
import unittest
from test_all import verbose
@ -51,6 +57,8 @@ class BaseThreadedTestCase(unittest.TestCase):
self.homeDir = homeDir
try:
os.mkdir(homeDir)
except WindowsError, e:
if e.errno <> 183: raise # ERROR_ALREADY_EXISTS
except OSError, e:
if e.errno <> errno.EEXIST: raise
self.env = db.DBEnv()