diff options
Diffstat (limited to 'debug_toolbar')
| -rw-r--r-- | debug_toolbar/panels/profiling.py | 4 | ||||
| -rw-r--r-- | debug_toolbar/utils/__init__.py | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/debug_toolbar/panels/profiling.py b/debug_toolbar/panels/profiling.py index c93c3b3..6adb279 100644 --- a/debug_toolbar/panels/profiling.py +++ b/debug_toolbar/panels/profiling.py @@ -2,6 +2,7 @@ from __future__ import division, unicode_literals from django.utils.translation import ugettext_lazy as _ from django.utils.safestring import mark_safe +from django.utils.six.moves import cStringIO from debug_toolbar.panels import DebugPanel try: @@ -11,7 +12,6 @@ except ImportError: DJ_PROFILE_USE_LINE_PROFILER = False -from cStringIO import StringIO import cProfile from pstats import Stats from colorsys import hsv_to_rgb @@ -128,7 +128,7 @@ class FunctionCall(object): if self._line_stats_text is None and DJ_PROFILE_USE_LINE_PROFILER: lstats = self.statobj.line_stats if self.func in lstats.timings: - out = StringIO() + out = cStringIO.StringIO() fn, lineno, name = self.func show_func(fn, lineno, name, lstats.timings[self.func], lstats.unit, stream=out) self._line_stats_text = out.getvalue() diff --git a/debug_toolbar/utils/__init__.py b/debug_toolbar/utils/__init__.py index 7efb106..ebd8b84 100644 --- a/debug_toolbar/utils/__init__.py +++ b/debug_toolbar/utils/__init__.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals import inspect import os.path import django -import SocketServer import sys from django.conf import settings @@ -11,10 +10,11 @@ from django.views.debug import linebreak_iter from django.utils.html import escape from django.utils.safestring import mark_safe from django.utils import six +from django.utils.six.moves import socketserver # Figure out some paths django_path = os.path.realpath(os.path.dirname(django.__file__)) -socketserver_path = os.path.realpath(os.path.dirname(SocketServer.__file__)) +socketserver_path = os.path.realpath(os.path.dirname(socketserver.__file__)) def ms_from_timedelta(td): @@ -31,7 +31,7 @@ def tidy_stacktrace(stack): """ Clean up stacktrace and remove all entries that: 1. Are part of Django (except contrib apps) - 2. Are part of SocketServer (used by Django's dev server) + 2. Are part of socketserver (used by Django's dev server) 3. Are the last entry (which is part of our stacktracing code) ``stack`` should be a list of frame tuples from ``inspect.stack()`` |
