[Zope3-checkins] CVS: Zope3/src/zope/fssync - merger.py:1.10
Guido van Rossum
guido@python.org
Wed, 28 May 2003 18:30:53 -0400
Update of /cvs-repository/Zope3/src/zope/fssync
In directory cvs.zope.org:/tmp/cvs-serv8963
Modified Files:
merger.py
Log Message:
It's better if cmpfile() doesn't die when either file doesn't exist,
but simply returns False.
=== Zope3/src/zope/fssync/merger.py 1.9 => 1.10 ===
--- Zope3/src/zope/fssync/merger.py:1.9 Wed May 28 16:23:55 2003
+++ Zope3/src/zope/fssync/merger.py Wed May 28 18:30:53 2003
@@ -283,7 +283,8 @@
def cmpfile(self, file1, file2):
"""Helper to compare two files.
- Return True iff the files are equal.
+ Return True iff the files both exist and are equal.
"""
- # XXX What should this do when either file doesn't exist?
+ if not (isfile(file1) and isfile(file2)):
+ return False
return filecmp.cmp(file1, file2, shallow=False)