diff -r 0e5421d679e7 -r ea526b78ee6c DebugClients/Python/ThreadExtension.py --- a/DebugClients/Python/ThreadExtension.py Tue Mar 07 18:46:09 2017 +0100 +++ b/DebugClients/Python/ThreadExtension.py Tue Mar 07 18:53:18 2017 +0100 @@ -140,19 +140,19 @@ except AssertionError: pass - def setCurrentThread(self, id): + def setCurrentThread(self, threadId): """ Public method to set the current thread. - @param id the id the current thread should be set to. + @param threadId the id the current thread should be set to. @type int """ try: self.lockClient() - if id is None: + if threadId is None: self.currentThread = None else: - self.currentThread = self.threads.get(id) + self.currentThread = self.threads.get(threadId) finally: self.unlockClient() @@ -167,10 +167,10 @@ # update thread names set by user (threading.setName) threadNames = {t.ident: t.getName() for t in threading.enumerate()} - for id, thd in self.threads.items(): - d = {"id": id} + for threadId, thd in self.threads.items(): + d = {"id": threadId} try: - d["name"] = threadNames.get(id, thd.name) + d["name"] = threadNames.get(threadId, thd.name) d["broken"] = thd.isBroken except Exception: d["name"] = 'UnknownThread' @@ -215,28 +215,28 @@ Public method to update the list of running threads. """ frames = sys._current_frames() - for id, frame in frames.items(): + for threadId, frame in frames.items(): # skip our own timer thread if frame.f_code.co_name == '__eventPollTimer': continue # Unknown thread - if id not in self.threads: + if threadId not in self.threads: newThread = DebugBase(self) name = 'Thread-{0}'.format(self.threadNumber) self.threadNumber += 1 - newThread.id = id + newThread.id = threadId newThread.name = name - self.threads[id] = newThread + self.threads[threadId] = newThread # adjust current frame if "__pypy__" not in sys.builtin_module_names: # Don't update with None currentFrame = self.getExecutedFrame(frame) if (currentFrame is not None and - self.threads[id].isBroken is False): - self.threads[id].currentFrame = currentFrame + self.threads[threadId].isBroken is False): + self.threads[threadId].currentFrame = currentFrame # Clean up obsolet because terminated threads self.threads = {id_: thrd for id_, thrd in self.threads.items()