Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix/fix error handling #1925

Closed
wants to merge 7 commits into from
Closed
2 changes: 1 addition & 1 deletion gyp/pylib/gyp/generator/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -1776,7 +1776,7 @@ def WriteMakeRule(self, outputs, inputs, actions=None, comment=None,
# - 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' % '@:')
Expand Down
4 changes: 2 additions & 2 deletions gyp/pylib/gyp/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,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
Expand Down Expand Up @@ -1090,7 +1090,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:
Expand Down