fallback to globals() if tables.index does not define an attribute

This commit is contained in:
evilchili 2024-01-17 22:37:53 -08:00
parent 1217c73c17
commit 6b3e094d79

View File

@ -19,4 +19,9 @@ index = dict(
def __getattr__(name: str) -> Any: def __getattr__(name: str) -> Any:
try:
return index[name] return index[name]
except KeyError:
if name in globals():
return globals()[name]
raise AttributeError(f"No such attribute: {name}")