From a523ca710b2668c09b976cfcfa2ba6ab4b572127 Mon Sep 17 00:00:00 2001 From: Graham Dumpleton Date: Sun, 1 Sep 2013 21:34:40 +1000 Subject: [PATCH] No need to traverse __wrapped__ when normal function. --- tests/test_synchronized_lock.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/test_synchronized_lock.py b/tests/test_synchronized_lock.py index 2d45073..9fe2254 100644 --- a/tests/test_synchronized_lock.py +++ b/tests/test_synchronized_lock.py @@ -19,11 +19,9 @@ def synchronized(wrapped, instance, args, kwargs): else: # Wrapped function is a normal function or static method. - # Synchronisation is against the individual function. We - # need to traverse __wrapped__ if it exists in case we are - # dealing with a bound static method. + # Synchronisation is against the individual function. - context = getattr(wrapped, '__wrapped__', wrapped) + context = wrapped name = '_synchronized_function_lock' else: