Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use hasattr to determine if handler is callable #1013

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

noahfrn
Copy link
Contributor

@noahfrn noahfrn commented Feb 24, 2024

callable() returns True for classes that override the __call__ method, which means the existing logic doesn't properly handle all backends (using a BookPostgres callback as the handler will break, for example).
This change uses hasattr to explicitly determine if the given handler:

Is a class
Has a start method
Has a stop method

@bmoscon bmoscon merged commit 7a982de into bmoscon:master Feb 26, 2024
2 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants