Browse Source

make dumping stack work in forked processes

harm 13 years ago
parent
commit
a1ba6375ac
1 changed files with 3 additions and 0 deletions
  1. 3 0
      celery/utils/__init__.py

+ 3 - 0
celery/utils/__init__.py

@@ -463,6 +463,9 @@ def cry():  # pragma: no cover
     sep = "=" * 49 + "\n"
     for tid, frame in sys._current_frames().iteritems():
         thread = tmap.get(tid, main_thread)
+        if not thread:
+            # skip old junk (left-overs from a fork)
+            continue
         out.write("%s\n" % (thread.getName(), ))
         out.write(sep)
         traceback.print_stack(frame, file=out)