summaryrefslogtreecommitdiffstats
path: root/Lib/threading.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/threading.py')
-rw-r--r--Lib/threading.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/Lib/threading.py b/Lib/threading.py
index 7237a14..d030e12 100644
--- a/Lib/threading.py
+++ b/Lib/threading.py
@@ -262,18 +262,12 @@ class Condition:
# If the lock defines _release_save() and/or _acquire_restore(),
# these override the default implementations (which just call
# release() and acquire() on the lock). Ditto for _is_owned().
- try:
+ if hasattr(lock, '_release_save'):
self._release_save = lock._release_save
- except AttributeError:
- pass
- try:
+ if hasattr(lock, '_acquire_restore'):
self._acquire_restore = lock._acquire_restore
- except AttributeError:
- pass
- try:
+ if hasattr(lock, '_is_owned'):
self._is_owned = lock._is_owned
- except AttributeError:
- pass
self._waiters = _deque()
def _at_fork_reinit(self):