[MERGE] dumpstacks fix from 6.1 branch

bzr revid: odo@openerp.com-20120316111105-c2g3mq6gzd9xe7bs
This commit is contained in:
Olivier Dony 2012-03-16 12:11:05 +01:00
commit d893cb3e80
1 changed files with 1 additions and 1 deletions

View File

@ -169,7 +169,7 @@ def dumpstacks(sig, frame):
id2name = dict([(threadId, thread.getName()) for threadId, thread in thread_map.items()])
code = []
for threadId, stack in sys._current_frames().items():
code.append("\n# Thread: %s(%d)" % (id2name[threadId], threadId))
code.append("\n# Thread: %s(%d)" % (id2name.get(threadId,'n/a'), threadId))
for filename, lineno, name, line in traceback.extract_stack(stack):
code.append('File: "%s", line %d, in %s' % (filename, lineno, name))
if line: