From: Martin v. Löwis Date: Sat, 6 May 2006 20:04:08 +0000 (+0000) Subject: Handle ERROR_ALREADY_EXISTS. X-Git-Tag: v2.5b1~696 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e93abb7ca65f030ef64784320058c0219c272d9e;p=python Handle ERROR_ALREADY_EXISTS. --- diff --git a/Lib/bsddb/test/test_thread.py b/Lib/bsddb/test/test_thread.py index 44e3e9ca51..61a0eb3380 100644 --- a/Lib/bsddb/test/test_thread.py +++ b/Lib/bsddb/test/test_thread.py @@ -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()