Skip to content

Commit

Permalink
fall back to getattr
Browse files Browse the repository at this point in the history
  • Loading branch information
lilyminium committed Nov 7, 2024
1 parent 4ea6d3a commit ce84b5e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion openff/toolkit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ def __getattr__(name):
obj_mod = _lazy_imports_obj.get(name)
if obj_mod is not None:
mod = importlib.import_module(obj_mod)
return mod.__dict__[name]
try:
return mod.__dict__[name]
except KeyError: # account for lazy loaders
return getattr(mod, name)

lazy_mod = _lazy_imports_mod.get(name)
if lazy_mod is not None:
Expand Down

0 comments on commit ce84b5e

Please sign in to comment.