From cf344f822e9e89a372d79c258bec2a4bbd471d60 Mon Sep 17 00:00:00 2001 From: Roy Tam Date: Sat, 3 Mar 2018 12:31:56 +0800 Subject: [PATCH] nsinstall.py: os.remove() may fail, handle it --- config/nsinstall.py | 5 ++++- js/src/config/nsinstall.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/config/nsinstall.py b/config/nsinstall.py index ae6132752..1033771ea 100644 --- a/config/nsinstall.py +++ b/config/nsinstall.py @@ -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: diff --git a/js/src/config/nsinstall.py b/js/src/config/nsinstall.py index ae6132752..1033771ea 100644 --- a/js/src/config/nsinstall.py +++ b/js/src/config/nsinstall.py @@ -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: