aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/utils/__init__.py
diff options
context:
space:
mode:
authorAndrey Grygoryev2012-01-13 00:01:49 +0200
committerAndrey Grygoryev2012-01-13 00:01:49 +0200
commit29f7d396d5c2006a8dd596d3ba14a1fc2b836c50 (patch)
treeaeed1f040a64327a5d42e2ea901841031f78b98b /debug_toolbar/utils/__init__.py
parent1076966c0f102945f24df04a03564c13f18b5922 (diff)
downloaddjango-debug-toolbar-29f7d396d5c2006a8dd596d3ba14a1fc2b836c50.tar.bz2
Fix python 2.5 compatibility (no named tuple and Traceback)
Diffstat (limited to 'debug_toolbar/utils/__init__.py')
-rw-r--r--debug_toolbar/utils/__init__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/debug_toolbar/utils/__init__.py b/debug_toolbar/utils/__init__.py
index 0a78dac..45dfc6f 100644
--- a/debug_toolbar/utils/__init__.py
+++ b/debug_toolbar/utils/__init__.py
@@ -129,7 +129,10 @@ def getframeinfo(frame, context=1):
else:
lines = index = None
- return inspect.Traceback(filename, lineno, frame.f_code.co_name, lines, index)
+ if hasattr(inspect, 'Traceback'):
+ return inspect.Traceback(filename, lineno, frame.f_code.co_name, lines, index)
+ else:
+ return (filename, lineno, frame.f_code.co_name, lines, index)
def get_stack(context=1):
"""