Closed daniel-o-jones closed 4 years ago
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 https://github.com/GrahamDumpleton/wrapt/commit/0c98567e78837bb39b2a498c13a0eb1403266bee
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 case