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

backoff.on_predicate does not work for staticmethods #200

Open
spokeydokeys opened this issue May 18, 2023 · 0 comments
Open

backoff.on_predicate does not work for staticmethods #200

spokeydokeys opened this issue May 18, 2023 · 0 comments

Comments

@spokeydokeys
Copy link

I'm decorating a staticmethod with backoff.on_predicate and when there is an error in the decorated methods I'm getting the error, TypeError: 'staticmethod' object is not callable. It seems that backoff is storing the static method unbound to the class and attempts to run the unbound descriptor rather than the embedded function.

I was able to get it to work locally by adding

target_fun = target.__func__ if isinstance(target, staticmethod) else target

in _sync.py (and doing something similar with the handlers).

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

No branches or pull requests

1 participant