| Index: pylib/gyp/common.py
|
| ===================================================================
|
| --- pylib/gyp/common.py (revision 379)
|
| +++ pylib/gyp/common.py (working copy)
|
| @@ -5,6 +5,7 @@
|
| import os.path
|
| import re
|
| import tempfile
|
| +import sys
|
|
|
|
|
| def BuildFileAndTarget(build_file, target):
|
| @@ -259,6 +260,11 @@
|
| umask = os.umask(077)
|
| os.umask(umask)
|
| os.chmod(self.tmp_path, 0666 & ~umask)
|
| + if sys.platform == 'win32':
|
| + # NOTE: on windows (but not cygwin) rename will not replace an
|
| + # existing file, so it must be preceded with a remove. Sadly there
|
| + # is no way to make the switch atomic.
|
| + os.remove(filename)
|
| os.rename(self.tmp_path, filename)
|
| except Exception:
|
| # Don't leave turds behind.
|
|
|