summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEneldo Serrata <eneldoserrata@gmail.com>2013-06-14 19:32:45 -0400
committerEneldo Serrata <eneldoserrata@gmail.com>2013-06-14 19:32:45 -0400
commit5baf766fec22a3ee5a5f00d2b8f79c8d63d40b58 (patch)
treef34f61f3701d7f98d43a47be618230d976a5d984
parent619e445ec168746512d163297b3422167763a719 (diff)
parent9b4d62b4e7a899f307dec59efffcee49bb931c69 (diff)
downloadcherrypy-git-5baf766fec22a3ee5a5f00d2b8f79c8d63d40b58.tar.gz
Merged in eneldoserrata/cherrypy-1/eneldoserrata/stringio-is-enough-without-the-if-sysver-1371252709662 (pull request #2)
StringIO is enough without the if sys.version...
-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()