diff options
| author | David Cramer | 2012-01-12 17:41:15 -0800 | 
|---|---|---|
| committer | David Cramer | 2012-01-12 17:41:15 -0800 | 
| commit | b5bce16616b54c0a524f6755951db2bbd46ff710 (patch) | |
| tree | aeed1f040a64327a5d42e2ea901841031f78b98b | |
| parent | 1076966c0f102945f24df04a03564c13f18b5922 (diff) | |
| parent | 29f7d396d5c2006a8dd596d3ba14a1fc2b836c50 (diff) | |
| download | django-debug-toolbar-b5bce16616b54c0a524f6755951db2bbd46ff710.tar.bz2 | |
Merge pull request #250 from GrAndSE/patch-2
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):      """ | 
