From 70225009afa59c8f765e16032e6e3efc8bdf00ec Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 21 Dec 2014 17:39:59 -0800 Subject: [PATCH] Fix bootstrap.py on posix platform --- script/bootstrap.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/script/bootstrap.py b/script/bootstrap.py index 0ca94fdc..924b893c 100755 --- a/script/bootstrap.py +++ b/script/bootstrap.py @@ -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) -- 2.43.0