mirror of
https://github.com/python/cpython.git
synced 2025-09-19 07:00:59 +00:00
mac robustness: default timezone, unlink target before rename
This commit is contained in:
parent
903f487684
commit
f6d69289a3
1 changed files with 4 additions and 0 deletions
|
@ -6,6 +6,8 @@ import time
|
||||||
import md5
|
import md5
|
||||||
import fnmatch
|
import fnmatch
|
||||||
|
|
||||||
|
if not hasattr(time, 'timezone'):
|
||||||
|
time.timezone = 0
|
||||||
|
|
||||||
class File:
|
class File:
|
||||||
|
|
||||||
|
@ -282,6 +284,8 @@ class CVS:
|
||||||
def backup(self, file):
|
def backup(self, file):
|
||||||
if os.path.isfile(file):
|
if os.path.isfile(file):
|
||||||
bfile = file + '~'
|
bfile = file + '~'
|
||||||
|
try: os.unlink(bfile)
|
||||||
|
except os.error: pass
|
||||||
os.rename(file, bfile)
|
os.rename(file, bfile)
|
||||||
|
|
||||||
def ignored(self, file):
|
def ignored(self, file):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue