]> granicus.if.org Git - python/commitdiff
Eliminate RLock race condition reported in SF bug #1764059
authorNick Coghlan <ncoghlan@gmail.com>
Tue, 31 Jul 2007 13:38:01 +0000 (13:38 +0000)
committerNick Coghlan <ncoghlan@gmail.com>
Tue, 31 Jul 2007 13:38:01 +0000 (13:38 +0000)
Lib/threading.py

index a46090d6b293423d6ea20cc7562255b250ffd879..5fc149dc33965f0b971da96196e7aef37b8c945a 100644 (file)
@@ -85,9 +85,10 @@ class _RLock(_Verbose):
         self.__count = 0
 
     def __repr__(self):
+        owner = self.__owner
         return "<%s(%s, %d)>" % (
                 self.__class__.__name__,
-                self.__owner and self.__owner.getName(),
+                owner and owner.getName(),
                 self.__count)
 
     def acquire(self, blocking=1):