Skip to content

Commit d8595d6

Browse files
committed
drop python 2 and six
1 parent d32e3d5 commit d8595d6

File tree

2 files changed

+6
-17
lines changed

2 files changed

+6
-17
lines changed

debug_toolbar_line_profiler/panel.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
1-
from __future__ import absolute_import, division, unicode_literals
2-
31
from colorsys import hsv_to_rgb
42
import cProfile
53
import inspect
64
import os
75
from pstats import Stats
8-
from six import PY2
96

107
from django.urls import resolve
118
from django.utils.translation import gettext_lazy as _
129
from django.utils.safestring import mark_safe
13-
try:
14-
from django.utils.six.moves import cStringIO
15-
except ImportError:
16-
from io import StringIO as cStringIO
10+
from io import StringIO
1711
from debug_toolbar.panels import Panel
1812
from django.views.generic.base import View
1913

@@ -145,7 +139,7 @@ def line_stats_text(self):
145139
if self._line_stats_text is None:
146140
lstats = self.statobj.line_stats
147141
if self.func in lstats.timings:
148-
out = cStringIO()
142+
out = StringIO()
149143
fn, lineno, name = self.func
150144
try:
151145
show_func(fn,
@@ -179,10 +173,7 @@ def _unwrap_closure_and_profile(self, func):
179173
self.line_profiler.add_function(func)
180174
for subfunc in getattr(func, 'profile_additional', []):
181175
self._unwrap_closure_and_profile(subfunc)
182-
if PY2:
183-
func_closure = func.func_closure
184-
else:
185-
func_closure = func.__closure__
176+
func_closure = func.__closure__
186177

187178
if func_closure:
188179
for cell in func_closure:

setup.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@
1313
license='BSD',
1414
packages=find_packages(exclude=('tests', 'example')),
1515
install_requires=[
16-
'django>=2.2',
17-
'django-debug-toolbar>=2.0',
18-
'line_profiler>=1.0b3',
19-
'six>=1.10',
16+
'django-debug-toolbar>=2.0.0',
17+
'line_profiler>=3.4.0',
2018
],
2119
include_package_data=True,
2220
zip_safe=False, # because we're including static files
@@ -29,7 +27,7 @@
2927
'Operating System :: OS Independent',
3028
'Programming Language :: Python',
3129
'Programming Language :: Python :: 3',
32-
'Programming Language :: Python :: 3.7',
30+
'Programming Language :: Python :: 3 :: Only',
3331
'Programming Language :: Python :: 3.8',
3432
'Programming Language :: Python :: 3.9',
3533
'Topic :: Software Development :: Libraries :: Python Modules',

0 commit comments

Comments
 (0)