[Python-checkins] r61243 - python/trunk/Lib/sqlite3/test/transactions.py
neal.norwitz
python-checkins at python.org
Wed Mar 5 06:20:44 CET 2008
Author: neal.norwitz
Date: Wed Mar 5 06:20:44 2008
New Revision: 61243
Modified:
python/trunk/Lib/sqlite3/test/transactions.py
Log:
Catch OSError when trying to remove a file in case removal fails. This
should prevent a failure in tearDown masking any real test failure.
Modified: python/trunk/Lib/sqlite3/test/transactions.py
==============================================================================
--- python/trunk/Lib/sqlite3/test/transactions.py (original)
+++ python/trunk/Lib/sqlite3/test/transactions.py Wed Mar 5 06:20:44 2008
@@ -32,7 +32,7 @@
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 @@
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)")
More information about the Python-checkins
mailing list