Skip to content

Commit

Permalink
Fix ValueError: invalid mode: 'rU' while trying to load binding.gyp
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss authored and ryzokuken committed Nov 27, 2020
1 parent eefe8d1 commit d0504e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pylib/gyp/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def LoadOneBuildFile(build_file_path, data, aux_data, includes, is_target, check
# 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()
if sys.platform == "zos":
if PY3 or 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()
Expand Down

0 comments on commit d0504e6

Please sign in to comment.