From f360d0b65ea68638c7d18d7e5222a67b90b5e5a2 Mon Sep 17 00:00:00 2001 From: Rob Thijssen Date: Mon, 18 Jul 2016 09:14:59 +0100 Subject: [PATCH] Bug 1287258 - retry deletions on windows; r=ted MozReview-Commit-ID: KObLa5RsjFW --- config/nsinstall.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/config/nsinstall.py b/config/nsinstall.py index 83e9139ee576..e633f5a73b26 100755 --- a/config/nsinstall.py +++ b/config/nsinstall.py @@ -11,6 +11,7 @@ # all related options. from __future__ import print_function from optparse import OptionParser +import mozfile import os import os.path import sys @@ -126,10 +127,10 @@ def _nsinstall_internal(argv): os.chmod(targetpath, options.m) else: if os.path.exists(targetpath): - # On Windows, read-only files can't be deleted if sys.platform == "win32": - os.chmod(targetpath, stat.S_IWUSR) - os.remove(targetpath) + mozfile.remove(targetpath) + else: + os.remove(targetpath) if options.t: shutil.copy2(srcpath, targetpath) else: