Package: python-django-debug-toolbar
Version: 0.8.1-1
Severity: normal
Tags: patch
Hi,
I get a syntax error when installing python-django-debug-toolbar on a system
with python2.4 installed:
-----------------------------------------------8<-----------------------------------------------
Unpacking python-django-debug-toolbar (from
.../python-django-debug-toolbar_0.8.1-1_all.deb) ...
Setting up python-django-debug-toolbar (0.8.1-1) ...
Processing triggers for python-support ...
Compiling /usr/lib/pymodules/python2.4/debug_toolbar/panels/sql.py ...
File "/usr/lib/pymodules/python2.4/debug_toolbar/panels/sql.py", line 113
finally:
^
SyntaxError: invalid syntax
-----------------------------------------------8<-----------------------------------------------
The attached patch separates and nests the try:...except: and try:...finally:
statements, fixing the problem.
Cheers, Til
-- System Information:
Debian Release: 5.0.3
APT prefers stable
APT policy: (500, 'stable'), (400, 'unstable'), (300, 'testing'), (200,
'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.26-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages python-django-debug-toolbar depends on:
ii libjs-jquery 1.2.6-2 JavaScript library for dynamic web
ii python-django 1.1.1-1 High-level Python web development
ii python-support 1.0.5 automated rebuilding support for P
Versions of packages python-django-debug-toolbar recommends:
ii python-pygments 0.10-1 syntax highlighting package writte
python-django-debug-toolbar suggests no packages.
-- no debconf information
--- debug_toolbar/panels/sql.py.orig 2009-12-02 08:15:10.441790678 +0100
+++ debug_toolbar/panels/sql.py 2009-12-02 08:16:26.799608573 +0100
@@ -101,15 +101,16 @@
template_info = None
cur_frame = sys._getframe().f_back
try:
- while cur_frame is not None:
- if cur_frame.f_code.co_name == 'render':
- node = cur_frame.f_locals['self']
- if isinstance(node, Node):
- template_info = get_template_info(node.source)
- break
- cur_frame = cur_frame.f_back
- except:
- pass
+ try:
+ while cur_frame is not None:
+ if cur_frame.f_code.co_name == 'render':
+ node = cur_frame.f_locals['self']
+ if isinstance(node, Node):
+ template_info = get_template_info(node.source)
+ break
+ cur_frame = cur_frame.f_back
+ except:
+ pass
finally:
del cur_frame