Skip to content

Commit

Permalink
only default to wrapped if instance is actually None
Browse files Browse the repository at this point in the history
fixes #145
  • Loading branch information
daniel-o-jones authored Jan 6, 2020
1 parent efa02c6 commit e50c8d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wrapt/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit e50c8d3

Please sign in to comment.