From: Cheng Zhao Date: Mon, 22 Dec 2014 01:39:59 +0000 (-0800) Subject: Fix bootstrap.py on posix platform X-Git-Tag: v0.20.2~1 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=70225009afa59c8f765e16032e6e3efc8bdf00ec;p=electron.git Fix bootstrap.py on posix platform --- 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)