[python2.6] don't add a name property on Thread stable
authorAlexandre Fayolle <alexandre.fayolle@logilab.fr>
Thu, 22 Apr 2010 19:37:56 +0000
branchstable
changeset 5376 2c3f14bc2590
parent 5375 962e13ab0930
child 5377 84d14ddfae13
[python2.6] don't add a name property on Thread in Python2.6 the threading.Thread class has a name attribute (used to be __name). The old code would trigger a infinite recursion.
server/repository.py
server/utils.py
--- a/server/repository.py	Thu Apr 22 18:25:34 2010 +0200
+++ b/server/repository.py	Thu Apr 22 19:37:56 2010 +0000
@@ -320,9 +320,9 @@
                 looptask.join()
                 self.info('task %s finished', looptask.name)
         for thread in self._running_threads:
-            self.info('waiting thread %s...', thread.name)
+            self.info('waiting thread %s...', thread.getName())
             thread.join()
-            self.info('thread %s finished', thread.name)
+            self.info('thread %s finished', thread.getName())
         if not (self.config.creating or self.config.repairing
                 or self.config.quick_start):
             self.hm.call_hooks('server_shutdown', repo=self)
--- a/server/utils.py	Thu Apr 22 18:25:34 2010 +0200
+++ b/server/utils.py	Thu Apr 22 19:37:56 2010 +0000
@@ -152,6 +152,5 @@
         self.daemon = True
         Thread.start(self)
 
-    @property
-    def name(self):
+    def getName(self):
         return '%s(%s)' % (self._name, Thread.getName(self))