Skip to content

Commit f151505

Browse files
committed
improve literals
1 parent aef48b4 commit f151505

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

mcdc/code_factory/literals_generator.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44

55

66
def _literalize(value):
7+
namespace = {}
78
jit_str = f"@njit\ndef impl():\n return {value}\n"
8-
exec(jit_str, globals(), locals())
9-
return eval("impl")
9+
exec(jit_str, globals(), namespace)
10+
return namespace["impl"]
1011

1112

1213
def make_literals(simulation):

0 commit comments

Comments
 (0)