]> khamidou — GitHub mirrors - electron.git/commitdiff
Fix bootstrap.py on posix platform
authorCheng Zhao <zcbenz@gmail.com>
Mon, 22 Dec 2014 01:39:59 +0000 (17:39 -0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 22 Dec 2014 01:39:59 +0000 (17:39 -0800)
script/bootstrap.py

index 0ca94fdc214fb3f1fe6f4d676bb743160fb68c62..924b893c0029c6c6568b1b5f64f444b280c74ae4 100755 (executable)
@@ -100,7 +100,11 @@ def create_chrome_version_h():
     version = f.read()
   with open(template_file, 'r') as f:
     template = f.read()
-  with open(target_file, 'wb+') as f:
+  if sys.platform in ['win32', 'cygwin']:
+    open_mode = 'wb+'
+  else:
+    open_mode = 'w+'
+  with open(target_file, open_mode) as f:
     content = template.replace('{PLACEHOLDER}', version.strip())
     if f.read() != content:
       f.write(content)