Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1611)

Unified Diff: pylib/gyp/common.py

Issue 49004: Fixing cygwin specific assumptions in gyp diff writer. (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: '' Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698