Fix bootstrap.py on posix platform

This commit is contained in:
Cheng Zhao 2014-12-21 17:39:59 -08:00
parent 80bea0766e
commit 70225009af

View file

@ -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)