[Zope3-checkins] CVS: Zope3/src/zope/fssync - compare.py:1.3

Guido van Rossum guido@python.org
Wed, 14 May 2003 18:13:52 -0400


Update of /cvs-repository/Zope3/src/zope/fssync
In directory cvs.zope.org:/tmp/cvs-serv8181

Modified Files:
	compare.py 
Log Message:
It's okay for an empty directory not to exist.


=== Zope3/src/zope/fssync/compare.py 1.2 => 1.3 ===
--- Zope3/src/zope/fssync/compare.py:1.2	Wed May 14 15:18:15 2003
+++ Zope3/src/zope/fssync/compare.py	Wed May 14 18:13:51 2003
@@ -38,7 +38,12 @@
     if not isdir(current):
         return []
     if not isdir(working):
-        return ["missing working directory %r" % working]
+        names = os.listdir(current)
+        if names:
+            return ["missing working directory %r" % working]
+        else:
+            # It's okay for an empty directory not to exist
+            return []
     errors = []
     for (left, right, common, lentries, rentries, ldirs, lnondirs,
          rdirs, rnondirs) in treeComparisonWalker(working, current):