[Zodb-checkins] CVS: Zope3/src/zodb/storage/tests - base.py:1.8

Tim Peters tim.one@comcast.net
Tue, 25 Feb 2003 17:57:53 -0500


Update of /cvs-repository/Zope3/src/zodb/storage/tests
In directory cvs.zope.org:/tmp/cvs-serv22232/src/zodb/storage/tests

Modified Files:
	base.py 
Log Message:
_zap_dbhome():  Don't call shutil.rmtree() unless the directory actually
exists.  Then there's no reason to try to suppress errors from rmtree.
Suppressing them hides worse problems (and problems that weren't intended
to be suppressed) on Windows.


=== Zope3/src/zodb/storage/tests/base.py 1.7 => 1.8 ===
--- Zope3/src/zodb/storage/tests/base.py:1.7	Tue Feb 25 17:30:18 2003
+++ Zope3/src/zodb/storage/tests/base.py	Tue Feb 25 17:57:52 2003
@@ -213,12 +213,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:
+        if os.path.isdir(dir):
             shutil.rmtree(dir)
-        except OSError, e:
-            if e.errno <> errno.ENOENT: raise
 
     def _mk_dbhome(self, dir=None):
         if dir is None: