From 650b3aad55f3319d6e604d8db8f79254ef03614d Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 19 May 1997 15:20:49 +0000 Subject: [PATCH] Unlink before rename (for NT). --- Tools/scripts/ftpmirror.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Tools/scripts/ftpmirror.py b/Tools/scripts/ftpmirror.py index 11b618f751d..f25864be497 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,