Format event handlers not in importable modules (#1875)

This commit is contained in:
Nikhil Rao 2023-09-27 11:30:15 -07:00 committed by GitHub
parent 4e82102ad0
commit 41872dfdc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -383,7 +383,7 @@ def get_event_handler_parts(handler: EventHandler) -> tuple[str, str]:
state = vars(sys.modules[handler.fn.__module__])[state_name]
except Exception:
# If the state isn't in the module, just return the function name.
return ("", handler.fn.__qualname__)
return ("", to_snake_case(handler.fn.__qualname__))
return (state.get_full_name(), name)