diff options
author | Robert Brewer <fumanchu@aminus.org> | 2011-02-24 09:55:44 +0000 |
---|---|---|
committer | Robert Brewer <fumanchu@aminus.org> | 2011-02-24 09:55:44 +0000 |
commit | ff046d016c899f071b9c0dabbd2ac80f702bf3eb (patch) | |
tree | 85fcdb690f7293e0d47ae8c502d9616c13b36977 /cherrypy/lib/profiler.py | |
parent | 0f0944e516a1aab4ff64ec14cfb4dd728bc33088 (diff) | |
download | cherrypy-git-ff046d016c899f071b9c0dabbd2ac80f702bf3eb.tar.gz |
Freeow. The magic cherrypy/_cpcompat.py module to take all our py3k fears away.
Diffstat (limited to 'cherrypy/lib/profiler.py')
-rw-r--r-- | cherrypy/lib/profiler.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/cherrypy/lib/profiler.py b/cherrypy/lib/profiler.py index a0543da9..785d58a3 100644 --- a/cherrypy/lib/profiler.py +++ b/cherrypy/lib/profiler.py @@ -53,10 +53,7 @@ import os, os.path import sys import warnings -try: - from cStringIO import StringIO -except ImportError: - from StringIO import StringIO +from cherrypy._cpcompat import BytesIO _count = 0 @@ -88,7 +85,7 @@ class Profiler(object): def stats(self, filename, sortby='cumulative'): """:rtype stats(index): output of print_stats() for the given profile. """ - sio = StringIO() + sio = BytesIO() if sys.version_info >= (2, 5): s = pstats.Stats(os.path.join(self.path, filename), stream=sio) s.strip_dirs() |