summaryrefslogtreecommitdiff
path: root/cherrypy/lib/profiler.py
diff options
context:
space:
mode:
authorEneldo Serrata <eneldoserrata@gmail.com>2013-06-14 23:32:14 +0000
committerEneldo Serrata <eneldoserrata@gmail.com>2013-06-14 23:32:14 +0000
commit9b4d62b4e7a899f307dec59efffcee49bb931c69 (patch)
treef34f61f3701d7f98d43a47be618230d976a5d984 /cherrypy/lib/profiler.py
parent619e445ec168746512d163297b3422167763a719 (diff)
downloadcherrypy-git-9b4d62b4e7a899f307dec59efffcee49bb931c69.tar.gz
StringIO is enough without the if sys.version...
--HG-- branch : eneldoserrata/stringio-is-enough-without-the-if-sysver-1371252709662
Diffstat (limited to 'cherrypy/lib/profiler.py')
-rw-r--r--cherrypy/lib/profiler.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/cherrypy/lib/profiler.py b/cherrypy/lib/profiler.py
index f7bf2eb3..39129bbe 100644
--- a/cherrypy/lib/profiler.py
+++ b/cherrypy/lib/profiler.py
@@ -53,7 +53,7 @@ import os, os.path
import sys
import warnings
-from cherrypy._cpcompat import BytesIO, StringIO
+from cherrypy._cpcompat import StringIO
_count = 0
@@ -85,10 +85,7 @@ class Profiler(object):
def stats(self, filename, sortby='cumulative'):
""":rtype stats(index): output of print_stats() for the given profile.
"""
- if sys.version_info >= (3, 0):
- sio = StringIO()
- else:
- sio = BytesIO()
+ sio = StringIO()
if sys.version_info >= (2, 5):
s = pstats.Stats(os.path.join(self.path, filename), stream=sio)
s.strip_dirs()