File tree Expand file tree Collapse file tree
cinderx/PythonLib/cinderx/compiler Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212import subprocess
1313import sys
1414import tempfile
15- from dis import dis
16- from types import CodeType
17- from typing import Pattern , TextIO
15+ from types import CodeType , ModuleType
16+ from typing import cast , Pattern , TextIO
1817
1918from . import get_disassembly_as_string
2019from .pycodegen import CinderCodeGenerator , compile_code , make_header
@@ -179,6 +178,11 @@ def main() -> None:
179178 source = f .read ()
180179
181180 pyrefly_cleanup_dir : str | None = None
181+ input_path : str = ""
182+ input_dir : str = ""
183+ types_dir : str = ""
184+ modules_list : list [dict [str , str ]] = []
185+ source_modules : set [str ] = set ()
182186 if args .pyrefly :
183187 input_path = os .path .abspath (args .input )
184188 input_dir = os .path .dirname (input_path )
@@ -259,7 +263,7 @@ def main() -> None:
259263 if args .static or args .strict or args .pyrefly :
260264 d ["<fixed-modules>" ] = FIXED_MODULES
261265 d ["<builtins>" ] = builtins .__dict__
262- sys .modules ["__main__" ] = mod
266+ sys .modules ["__main__" ] = cast ( ModuleType , mod )
263267 # don't confuse the script with args meant for us
264268 sys .argv = sys .argv [:1 ]
265269
You can’t perform that action at this time.
0 commit comments