diff --git a/src/wrapt/decorators.py b/src/wrapt/decorators.py index 11e11ded..795d525e 100644 --- a/src/wrapt/decorators.py +++ b/src/wrapt/decorators.py @@ -496,7 +496,7 @@ def _synchronized_wrapper(wrapped, instance, args, kwargs): # desired context is held. If instance is None then the # wrapped function is used as the context. - with _synchronized_lock(instance or wrapped): + with _synchronized_lock(instance if instance is not None else wrapped): return wrapped(*args, **kwargs) class _FinalDecorator(FunctionWrapper):