diff options
author | mcgrathr@chromium.org <mcgrathr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-09 22:38:27 +0000 |
---|---|---|
committer | mcgrathr@chromium.org <mcgrathr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-09 22:38:27 +0000 |
commit | 1844318826513733b607f21d07885a963fef46d7 (patch) | |
tree | ce34f4c438d009f49179dffd8e1a654caec549c3 /ppapi | |
parent | a7a5d84fc4cc56c5b26d5d8b5a0a0d9bddd81047 (diff) | |
download | chromium_src-1844318826513733b607f21d07885a963fef46d7.zip chromium_src-1844318826513733b607f21d07885a963fef46d7.tar.gz chromium_src-1844318826513733b607f21d07885a963fef46d7.tar.bz2 |
srpcgen: Open output files as binary
Opening the output files in binary mode ensures that they are always
written with LF line-endings, never with CRLF on Windows.
BUG= none
TEST= none
R=noelallen@google.com,noelallen@chromium.org,bradnelson@google.com
Review URL: http://codereview.chromium.org/9161001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116936 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rwxr-xr-x | ppapi/native_client/src/tools/srpcgen.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ppapi/native_client/src/tools/srpcgen.py b/ppapi/native_client/src/tools/srpcgen.py index 2a59b35..c74e2cc 100755 --- a/ppapi/native_client/src/tools/srpcgen.py +++ b/ppapi/native_client/src/tools/srpcgen.py @@ -412,12 +412,14 @@ def main(argv): # Get the name of the header file to be generated. h_file_name = pargs[2] MakePath(h_file_name) - h_file = open(h_file_name, 'w') + # Note we open output files in binary mode so that on Windows the files + # will always get LF line-endings rather than CRLF. + h_file = open(h_file_name, 'wb') # Get the name of the source file to be generated. Depending upon whether # -c or -s is generated, this file contains either client or server methods. cc_file_name = pargs[3] MakePath(cc_file_name) - cc_file = open(cc_file_name, 'w') + cc_file = open(cc_file_name, 'wb') # The remaining arguments are the spec files to be compiled. spec_files = pargs[4:] |