Skip to content

Commit

Permalink
use symtable in python instead of c api
Browse files Browse the repository at this point in the history
Summary:
Removes the call to `mod.symtable` to avoid depending on the
result of `check_source`

Reviewed By: carljm

Differential Revision: D49655872

fbshipit-source-id: e52475314eeff748a7cddd7556da250ccd1ba331
  • Loading branch information
pilleye authored and facebook-github-bot committed Oct 6, 2023
1 parent 66a210b commit 0a93f1d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Lib/compiler/strict/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import builtins
import logging
import os
import symtable
import sys
from contextlib import nullcontext
from symtable import SymbolTable as PythonSymbolTable, SymbolTableFactory
Expand Down Expand Up @@ -184,7 +185,7 @@ def load_compiled_module_from_source(
error = errors[0]
raise StrictModuleError(error[0], error[1], error[2], error[3])
elif is_valid_strict:
symbols = getSymbolTable(mod)
symbols = symtable.symtable(source, filename, "exec")
try:
check_class_conflict(pyast, filename, symbols)
except StrictModuleError as e:
Expand Down

0 comments on commit 0a93f1d

Please sign in to comment.