Skip to content

Commit 1b7f4f2

Browse files
generatedunixname1431085361989520meta-codesync[bot]
authored andcommitted
Fix broken fbcode//cinderx/PythonLib:compiler-main-type-checking - unmanaged caused by D102892176
Reviewed By: alexmalyshev, yoney Differential Revision: D103566916 fbshipit-source-id: 263cf8f58d73b0f5b5af616a6c8680349e2e10f2
1 parent 95846d0 commit 1b7f4f2

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

cinderx/PythonLib/cinderx/compiler/__main__.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
import subprocess
1313
import sys
1414
import 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

1918
from . import get_disassembly_as_string
2019
from .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

0 commit comments

Comments
 (0)