fallback to globals() if tables.index does not define an attribute
This commit is contained in:
parent
1217c73c17
commit
6b3e094d79
|
@ -19,4 +19,9 @@ index = dict(
|
||||||
|
|
||||||
|
|
||||||
def __getattr__(name: str) -> Any:
|
def __getattr__(name: str) -> Any:
|
||||||
return index[name]
|
try:
|
||||||
|
return index[name]
|
||||||
|
except KeyError:
|
||||||
|
if name in globals():
|
||||||
|
return globals()[name]
|
||||||
|
raise AttributeError(f"No such attribute: {name}")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user