[Zope-Checkins] CVS: ZODB3/BDBStorage/tests - BerkeleyTestBase.py:1.16

Tim Peters tim.one@comcast.net
Thu, 24 Jul 2003 11:57:44 -0400


Update of /cvs-repository/ZODB3/BDBStorage/tests
In directory cvs.zope.org:/tmp/cvs-serv12087/BDBStorage/tests

Modified Files:
	BerkeleyTestBase.py 
Log Message:
_zap_dbhome():  Backported simpler implementation from ZODB4; this one
has the virtue of working on Windows too.


=== ZODB3/BDBStorage/tests/BerkeleyTestBase.py 1.15 => 1.16 ===
--- ZODB3/BDBStorage/tests/BerkeleyTestBase.py:1.15	Tue Jan 28 11:46:08 2003
+++ ZODB3/BDBStorage/tests/BerkeleyTestBase.py	Thu Jul 24 11:57:39 2003
@@ -45,12 +45,8 @@
     def _zap_dbhome(self, dir=None):
         if dir is None:
             dir = self._envdir()
-        # XXX Pre-Python 2.3 doesn't ignore errors if the first arg doesn't
-        # exist, even if the second is True.
-        try:
-            shutil.rmtree(dir, 1)
-        except OSError, e:
-            if e.errno <> errno.ENOENT: raise
+        if os.path.isdir(dir):
+            shutil.rmtree(dir)
 
     def _mk_dbhome(self, dir=None):
         if dir is None: