mirror of https://github.com/python/cpython
Handle ERROR_ALREADY_EXISTS.
This commit is contained in:
parent
d4e3bb3d39
commit
e93abb7ca6
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue