Skip to content

Commit

Permalink
[FIX] openerp-server: allow missing thread names in dump_stacks
Browse files Browse the repository at this point in the history
Report-printing threads don't seem to be included
in the list of active threads, but do need to
be dumped as well.

bzr revid: [email protected]
  • Loading branch information
odony committed Mar 15, 2012
1 parent 975667d commit 4238bc9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openerp-server
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 4238bc9

Please sign in to comment.