]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
mac robustness: default timezone, unlink target before rename
authorGuido van Rossum <guido@python.org>
Sat, 7 Oct 1995 19:25:25 +0000 (19:25 +0000)
committerGuido van Rossum <guido@python.org>
Sat, 7 Oct 1995 19:25:25 +0000 (19:25 +0000)
Demo/pdist/cvslib.py

index 96cc785d0daf8037ffc6ddd687210edd4c0da810..cf305c97982d044053c7b1060f3a8aa0022510e8 100755 (executable)
@@ -6,6 +6,8 @@ import time
 import md5
 import fnmatch
 
+if not hasattr(time, 'timezone'):
+       time.timezone = 0
 
 class File:
 
@@ -282,6 +284,8 @@ class CVS:
        def backup(self, file):
                if os.path.isfile(file):
                        bfile = file + '~'
+                       try: os.unlink(bfile)
+                       except os.error: pass
                        os.rename(file, bfile)
 
        def ignored(self, file):