-
Notifications
You must be signed in to change notification settings - Fork 235
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
issue with instance context within the synchronized decorator #145
Comments
Yep. Am curious though as to what type of object you were applying it to that you hit that. An instance of some custom type of your own, or something from a third party library? |
Add test and change notes in 0c98567 |
Note that I will probably only release a new version in a week or so. Am about to be travelling for a bit and don't want to do it right now as internet access the next week may be unpredictable. |
We were using an internal object that is a cache. When it's empty it is falsey. Looking forward to the update! |
I've run into an issue using wrapt's
synchronized
decoratorPrevious behaviour and comment in the
_synchronized_wrapper
function implies theinstance
has to beNone
beforewrapped
is used as the context in the_synchronized_lock
function. But the way it's working now means that a Falsey (but not None) instance isn't getting used as thecontext
Changing line 499 to
with _synchronized_lock(instance if instance is not None else wrapped):
is a one line solution of the problem that works for our use caseThe text was updated successfully, but these errors were encountered: