Skip to content

Commit

Permalink
zos: don't use universal-new-lines mode
Browse files Browse the repository at this point in the history
PR-URL: #1451
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Refael Ackermann <refack@gmail.com>
  • Loading branch information
jBarz authored and bnoordhuis committed Jun 8, 2018
1 parent 02ac2e7 commit eaedc12
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gyp/pylib/gyp/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,12 @@ def LoadOneBuildFile(build_file_path, data, aux_data, includes,
# Open the build file for read ('r') with universal-newlines mode ('U')
# to make sure platform specific newlines ('\r\n' or '\r') are converted to '\n'
# which otherwise will fail eval()
build_file_contents = open(build_file_path, 'rU').read()
if sys.platform == 'zos':
# On z/OS, universal-newlines mode treats the file as an ascii file. But since
# node-gyp produces ebcdic files, do not use that mode.
build_file_contents = open(build_file_path, 'r').read()
else:
build_file_contents = open(build_file_path, 'rU').read()
else:
raise GypError("%s not found (cwd: %s)" % (build_file_path, os.getcwd()))

Expand Down

0 comments on commit eaedc12

Please sign in to comment.