mirror of
https://github.com/roytam1/palemoon26.git
synced 2026-05-26 05:44:31 +00:00
nsinstall.py: os.remove() may fail, handle it
This commit is contained in:
+4
-1
@@ -128,7 +128,10 @@ def _nsinstall_internal(argv):
|
||||
if os.path.exists(targetpath):
|
||||
# On Windows, read-only files can't be deleted
|
||||
os.chmod(targetpath, stat.S_IWUSR)
|
||||
os.remove(targetpath)
|
||||
try:
|
||||
os.remove(targetpath)
|
||||
except:
|
||||
pass
|
||||
if options.t:
|
||||
shutil.copy2(srcpath, targetpath)
|
||||
else:
|
||||
|
||||
@@ -128,7 +128,10 @@ def _nsinstall_internal(argv):
|
||||
if os.path.exists(targetpath):
|
||||
# On Windows, read-only files can't be deleted
|
||||
os.chmod(targetpath, stat.S_IWUSR)
|
||||
os.remove(targetpath)
|
||||
try:
|
||||
os.remove(targetpath)
|
||||
except:
|
||||
pass
|
||||
if options.t:
|
||||
shutil.copy2(srcpath, targetpath)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user