mirror of
https://github.com/electron/node-gyp.git
synced 2025-08-15 12:58:19 +02:00
gyp: python3 fixes: utf8 decode, use of 'None' in eval
PR-URL: https://github.com/nodejs/node-gyp/pull/1925 Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
This commit is contained in:
parent
c0282daa48
commit
1b11be63cc
2 changed files with 3 additions and 3 deletions
|
@ -1776,7 +1776,7 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD
|
|||
# - The multi-output rule will have an do-nothing recipe.
|
||||
|
||||
# Hash the target name to avoid generating overlong filenames.
|
||||
cmddigest = hashlib.sha1(command if command else self.target).hexdigest()
|
||||
cmddigest = hashlib.sha1((command or self.target).encode('utf-8')).hexdigest()
|
||||
intermediate = "%s.intermediate" % cmddigest
|
||||
self.WriteLn('%s: %s' % (' '.join(outputs), intermediate))
|
||||
self.WriteLn('\t%s' % '@:')
|
||||
|
|
|
@ -240,7 +240,7 @@ def LoadOneBuildFile(build_file_path, data, aux_data, includes,
|
|||
if check:
|
||||
build_file_data = CheckedEval(build_file_contents)
|
||||
else:
|
||||
build_file_data = eval(build_file_contents, {'__builtins__': None},
|
||||
build_file_data = eval(build_file_contents, {'__builtins__': {}},
|
||||
None)
|
||||
except SyntaxError as e:
|
||||
e.filename = build_file_path
|
||||
|
@ -1094,7 +1094,7 @@ def EvalSingleCondition(
|
|||
else:
|
||||
ast_code = compile(cond_expr_expanded, '<string>', 'eval')
|
||||
cached_conditions_asts[cond_expr_expanded] = ast_code
|
||||
if eval(ast_code, {'__builtins__': None}, variables):
|
||||
if eval(ast_code, {'__builtins__': {}}, variables):
|
||||
return true_dict
|
||||
return false_dict
|
||||
except SyntaxError as e:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue