Eneldo Serrata avatar Eneldo Serrata committed 7b96014 Merge

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...

Comments (0)

Files changed (1)

cherrypy/lib/profiler.py

 import sys
 import warnings
 
-from cherrypy._cpcompat import BytesIO, StringIO
+from cherrypy._cpcompat import StringIO
 
 _count = 0
 
     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()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.