Commits

Samuel Bronson  committed be1f12b

Try to deal with programs (e.g., bzr) that avoid sys.exit(),
but still run atexit handlers.

  • Participants
  • Parent commits 30eec47

Comments (0)

Files changed (1)

File pyprof2calltree.py

             outfile = '%s.log' % os.path.basename(options.script)
 
         prof = cProfile.Profile()
+
+        # Try to deal with programs (e.g., bzr) that avoid sys.exit(),
+        # but still run atexit handlers.
+        import atexit
+        atexit.register(exit)
+
         try:
             try:
                 prof = prof.run('execfile(%r)' % (sys.argv[0],))