Skip to content

Commit

Permalink
Merge pull request #146 from daniel-o-jones/daniel-o-jones-patch-1
Browse files Browse the repository at this point in the history
Only default to wrapped if instance is actually None.
  • Loading branch information
GrahamDumpleton committed Jan 6, 2020
2 parents efa02c6 + e50c8d3 commit d7ab8d8
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 d7ab8d8

Please sign in to comment.