diff options
author | Guido van Rossum <guido@python.org> | 1997-05-19 15:20:49 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-05-19 15:20:49 (GMT) |
commit | 650b3aad55f3319d6e604d8db8f79254ef03614d (patch) | |
tree | 90d236aa3cb89e2696ef948d47ca0753caaa00b1 /Tools | |
parent | 1aa7e3a177756b9407cdde745fbb4adf7da35dbe (diff) | |
download | cpython-650b3aad55f3319d6e604d8db8f79254ef03614d.zip cpython-650b3aad55f3319d6e604d8db8f79254ef03614d.tar.gz cpython-650b3aad55f3319d6e604d8db8f79254ef03614d.tar.bz2 |
Unlink before rename (for NT).
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/scripts/ftpmirror.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Tools/scripts/ftpmirror.py b/Tools/scripts/ftpmirror.py index 11b618f..f25864b 100755 --- a/Tools/scripts/ftpmirror.py +++ b/Tools/scripts/ftpmirror.py @@ -198,7 +198,11 @@ def mirrorsubdir(f, localdir): if fp1 != fp: fp1.close() try: - os.rename(tempname, fullname) + os.unlink(fullname) + except os.error: + pass # Ignore the error + try: + os.rename(tempname, fullname) except os.error, msg: print "Can't rename %s to %s: %s" % (tempname, fullname, |