fallback to globals() if tables.index does not define an attribute
This commit is contained in:
1 parent
1217c73c17
commit
6b3e094d79
1 file changed
+6
-1
+6
-1
@@ -19,4 +19,9 @@ index = dict(
|
||||
|
||||
|
||||
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}")
|
||||
Reference in new issue
Block a user