Skip to content

Commit

Permalink
Don't pass filename if empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
tseaver committed May 12, 2011
1 parent fe67b61 commit 0761d11
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions repoze/profile/profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def index(self, environ, output=None): # output=None D/I for testing
full_dirs = int(querydata.get('full_dirs', 0))
sort = querydata.get('sort', 'time')
clear = querydata.get('clear', None)
filename = querydata.get('filename', None)
filename = querydata.get('filename', '').strip()
limit = int(querydata.get('limit', 100))
mode = querydata.get('mode', 'stats')
if output is None:
Expand All @@ -85,7 +85,10 @@ def index(self, environ, output=None): # output=None D/I for testing
orig_stdout = sys.stdout # python 2.4
sys.stdout = output
print_fn = getattr(stats, 'print_%s' % mode)
print_fn(filename, limit)
if filename:
print_fn(filename, limit)
else:
print_fn(limit)
finally:
sys.stdout = orig_stdout

Expand Down

0 comments on commit 0761d11

Please sign in to comment.