Skip to content

Commit

Permalink
Merge pull request cupy#8982 from kmaehashi/fix-exec-local
Browse files Browse the repository at this point in the history
Pass `locals` dict to `exec`
  • Loading branch information
kmaehashi authored and chainer-ci committed Feb 25, 2025
1 parent c986ec6 commit 8adcd7d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/typing_tests/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ def test_run(t: Path) -> None:
with open(t) as f:
lines = f.readlines()

exec_locals = {}
for _lineno, _line in enumerate(lines, start=1):
if "# E: " not in _line:
try:
exec(_line)
exec(_line, None, exec_locals)
except Exception:
print(f"{t}:{_lineno} {_line}")
raise

0 comments on commit 8adcd7d

Please sign in to comment.