Pylons/pyramid_debugtoolbar — Issue #48: pyramid_debugtoolbar 0.9.6 raises NameError when used with mako.strict_undefined = true
Author: xrotwang
Created: 2011-12-09 09:32:47+00:00
State: open

The performance panel of the debugtoolbar uses a variable function_calls which is not initialised when no stats are collected. This causes a NameError when mako renders the template with the strict_undefined option.
The following patch fixes this problem:

$ diff lib/python2.6/site-packages/pyramid_debugtoolbar/panels/performance.py lib/python2.6/site-packages/pyramid_debugtoolbar/panels/performance.py.orig
161c161
< vars = {'timing_rows':None, 'stats':None, 'function_calls':[]}
---
> vars = {'timing_rows':None, 'stats':None}