diff options
| author | Andrey Grygoryev | 2012-01-13 00:01:49 +0200 | 
|---|---|---|
| committer | Andrey Grygoryev | 2012-01-13 00:01:49 +0200 | 
| commit | 29f7d396d5c2006a8dd596d3ba14a1fc2b836c50 (patch) | |
| tree | aeed1f040a64327a5d42e2ea901841031f78b98b | |
| parent | 1076966c0f102945f24df04a03564c13f18b5922 (diff) | |
| download | django-debug-toolbar-29f7d396d5c2006a8dd596d3ba14a1fc2b836c50.tar.bz2 | |
Fix python 2.5 compatibility (no named tuple and Traceback)
| -rw-r--r-- | debug_toolbar/utils/__init__.py | 5 | 
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):      """ | 
