1. Samuel Bronson
  2. pyprof2calltree

Commits

Samuel Bronson  committed aa2e180

Clarify the sys.exit()-avoidance countermeasures.

  • Participants
  • Parent commits be1f12b
  • Branches default

Comments (0)

Files changed (1)

File pyprof2calltree.py

View file
         # Try to deal with programs (e.g., bzr) that avoid sys.exit(),
         # but still run atexit handlers.
         import atexit
-        atexit.register(exit)
-
+        atexit.register(sys.exit)
+        # sys.exit() raises SystemExit, which we catch below.
         try:
             try:
                 prof = prof.run('execfile(%r)' % (sys.argv[0],))