Skip to content

Add support for Python 3 #373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 34 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
eb0d02d
Add python 3.3 and 3.2 as allow_failures
graingert Apr 8, 2013
eb53791
add <1.6 to tests_require
graingert Apr 8, 2013
005ca0b
use sqlparse from pypi
graingert Apr 8, 2013
c73c77a
remove support for django <1.4.2
graingert Apr 8, 2013
c58094b
use new style exception in __init__.py
graingert Apr 8, 2013
e749ab1
port imports to py3k in middleware.py
graingert Apr 8, 2013
f6aad29
support new style exceptions in loader.py
graingert Apr 8, 2013
f1d5de5
port imports to py3k in utils/__init__.py
graingert Apr 8, 2013
61d1286
support new style exceptions in utils/tracking/__init__.py
graingert Apr 8, 2013
e4e8388
use force_text instead of force_unicode
graingert Apr 8, 2013
e3723e3
remove use of deprecated sqlparse.filters.Filters
graingert Apr 8, 2013
bab0aee
use thread from six.moves in tests/tests.py
graingert Apr 8, 2013
417c852
use assertEqual instead of assertEquals in tests
graingert Apr 8, 2013
3929d60
use iteritems from six, or items in templates
graingert Apr 8, 2013
068a6c1
use string_types from six instead of basestring
graingert Apr 8, 2013
7cb3cb0
use iterkeys and itervalues from six, or .keys and .values in templates
graingert Apr 8, 2013
c2485f5
deprecate functions unusable on Python3
graingert Apr 9, 2013
61bbd7f
use more simpler, more portable monkey_patch_call func in tracking
graingert Apr 9, 2013
cdfa803
use map from six
graingert Apr 9, 2013
494f421
force more things to bytes before hashing
graingert Apr 9, 2013
a30c83f
use text_type instead of unicode
graingert Apr 9, 2013
6e50c9f
add DJANGO_VERSION=1.5 to allow_failures
graingert Apr 9, 2013
47ea676
fix print function
w-diesel Apr 14, 2013
76a8159
Update profiling.py, attr. "func_closure" ( py2.6)
w-diesel Apr 14, 2013
f5d4cde
remove u'' prefix, import __future__ unicode_lit..
w-diesel Apr 14, 2013
0e6983a
use force_bytes to encode before hashing
graingert Apr 14, 2013
a088ed0
list expected
w-diesel Apr 14, 2013
3aa8c4c
Update middleware.py
w-diesel Apr 14, 2013
7a21c54
cache.py, fix python3.2 support
w-diesel Apr 15, 2013
fa40aa1
Masterbranch can pass all original tests on 1.5ver
w-diesel Apr 16, 2013
ee44437
Update .travis.yml
w-diesel Apr 16, 2013
fd2bb66
use unittest.skipIf to skip tests invalid on PY3
graingert Apr 23, 2013
09203c6
bump django version requirements to 1.4.5
graingert Apr 25, 2013
9a924cd
remove spaces from print functions
graingert Apr 25, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update profiling.py, attr. "func_closure" ( py2.6)
change attributes "func_code" -> "__code__" and "func_closure" -> "__closure__"   ( => python2.6 )
  • Loading branch information
w-diesel committed Apr 14, 2013
commit 76a8159a552c5b99a284dbc205364e2cf5357385
9 changes: 5 additions & 4 deletions debug_toolbar/panels/profiling.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import unicode_literals
from __future__ import division

from django.utils.six import iteritems
Expand Down Expand Up @@ -156,12 +157,12 @@ def title(self):
return _('Profiling')

def _unwrap_closure_and_profile(self, func):
if not hasattr(func, 'func_code'):
if not hasattr(func, '__code__'):
return
self.line_profiler.add_function(func)
if func.func_closure:
for cell in func.func_closure:
if hasattr(cell.cell_contents, 'func_code'):
if func.__closure__:
for cell in func.__closure__:
if hasattr(cell.cell_contents, '__code__'):
self._unwrap_closure_and_profile(cell.cell_contents)

def process_view(self, request, view_func, view_args, view_kwargs):
Expand Down