ruff: Fix B009 Do not call getattr with a constant attribute value.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2023-10-29 17:37:32 -07:00
parent 7aeb8f2619
commit 272c63bfd3

View file

@ -87,7 +87,7 @@ def get_handle(location: str) -> Optional[Callable[[Dict[str, Any]], Optional[st
if not isinstance(loader, importlib.abc.Loader):
return None
loader.exec_module(handler)
return getattr(handler, "handle")
return handler.handle
except Exception as e:
print(e)
return None