Skip to content

Commit

Permalink
core.main: pipe the profiler stream to stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
hut committed Jan 11, 2012
1 parent 907e3fd commit 4904e06
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ranger/core/main.py
Expand Up @@ -127,7 +127,7 @@ def print_function(string):
profile = None
ranger.__fm = fm
cProfile.run('ranger.__fm.loop()', '/tmp/ranger_profile')
profile = pstats.Stats('/tmp/ranger_profile')
profile = pstats.Stats('/tmp/ranger_profile', stream=sys.stderr)
else:
fm.loop()
except Exception:
Expand All @@ -146,9 +146,7 @@ def print_function(string):
except (AttributeError, NameError):
pass
if ranger.arg.profile and profile:
stdout, sys.stdout = sys.stdout, sys.stderr
profile.strip_dirs().sort_stats('cumulative').print_callees(100)
sys.stdout = stdout
profile.strip_dirs().sort_stats('cumulative').print_callees()
if crash_traceback:
print("ranger version: %s, executed with python %s" %
(ranger.__version__, sys.version.split()[0]))
Expand Down

0 comments on commit 4904e06

Please sign in to comment.