Skip to content

Commit 830bc92

Browse files
DinoVmeta-codesync[bot]
authored andcommitted
Run static python code in a strict module
Summary: Currently we're importing StrictModule from cinder and never finding it. We also wouldn't use it on a static module if we had it but it improves what the JIT can do. So now we use it if we're in strict or static mode. Reviewed By: alexmalyshev Differential Revision: D103307685 fbshipit-source-id: b954124e75645ce98a0045bd863e5906f1bdbbc0
1 parent 73ec3cb commit 830bc92

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

cinderx/PythonLib/cinderx/compiler/__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from .strict import StrictCodeGenerator
2424

2525
try:
26-
from cinder import StrictModule
26+
from cinderx import StrictModule
2727
except ImportError:
2828
StrictModule = None
2929

@@ -250,7 +250,7 @@ def main() -> None:
250250
f.write(hdr)
251251
marshal.dump(codeobj, f)
252252
else:
253-
if args.strict and StrictModule is not None:
253+
if (args.strict or args.static) and StrictModule is not None:
254254
d: dict[str, object] = {"__name__": "__main__"}
255255
mod = StrictModule(d, False)
256256
else:

0 commit comments

Comments
 (0)