summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2008-03-05 05:20:44 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2008-03-05 05:20:44 (GMT)
commitce527883dcf59c70f80e9aab2076f556300af93f (patch)
treed210cb334514aa533cd518f292c2dd25f53acb6c
parent218072595e815b584e78b7af97d01e14e9b919f5 (diff)
downloadcpython-ce527883dcf59c70f80e9aab2076f556300af93f.zip
cpython-ce527883dcf59c70f80e9aab2076f556300af93f.tar.gz
cpython-ce527883dcf59c70f80e9aab2076f556300af93f.tar.bz2
Catch OSError when trying to remove a file in case removal fails. This
should prevent a failure in tearDown masking any real test failure.
-rw-r--r--Lib/sqlite3/test/transactions.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/sqlite3/test/transactions.py b/Lib/sqlite3/test/transactions.py
index 14cae25..d4f7d62 100644
--- a/Lib/sqlite3/test/transactions.py
+++ b/Lib/sqlite3/test/transactions.py
@@ -32,7 +32,7 @@ class TransactionTests(unittest.TestCase):
def setUp(self):
try:
os.remove(get_db_path())
- except:
+ except OSError:
pass
self.con1 = sqlite.connect(get_db_path(), timeout=0.1)
@@ -48,7 +48,10 @@ class TransactionTests(unittest.TestCase):
self.cur2.close()
self.con2.close()
- os.unlink(get_db_path())
+ try:
+ os.unlink(get_db_path())
+ except OSError:
+ pass
def CheckDMLdoesAutoCommitBefore(self):
self.cur1.execute("create table test(i)")