Commit 95ea8fc7 authored by Shane Hathaway's avatar Shane Hathaway

Fixed a bug that caused dtml-try to throw a KeyError. Related to

the recent changes made to DT_Util.namespace().
parent 39bb110d
......@@ -240,7 +240,7 @@ class Try:
f=StringIO()
traceback.print_exc(100,f)
error_tb=f.getvalue()
ns = namespace(self, error_type=errname, error_value=v,
ns = namespace(md, error_type=errname, error_value=v,
error_tb=error_tb)[0]
md._push(InstanceDict(ns,md))
return render_blocks(handler, md)
......
......@@ -82,8 +82,8 @@
# attributions are listed in the accompanying credits file.
#
##############################################################################
'''$Id: DT_Util.py,v 1.67 2000/06/16 19:31:37 shane Exp $'''
__version__='$Revision: 1.67 $'[11:-2]
'''$Id: DT_Util.py,v 1.68 2000/06/29 14:34:19 shane Exp $'''
__version__='$Revision: 1.68 $'[11:-2]
import regex, string, math, os
from string import strip, join, atoi, lower, split, find
......@@ -252,13 +252,13 @@ d['getattr']=careful_getattr
d['hasattr']=careful_hasattr
d['range']=careful_range
class namespace_:
__allow_access_to_unprotected_subobjects__=1
#class namespace_:
# __allow_access_to_unprotected_subobjects__=1
def namespace(self, **kw):
"""Create a tuple consisting of a single instance whos attributes are
provided as keyword arguments."""
# NOTE: the self argument needs to be a TemplateDict instance.
return apply(self, (), kw)
d['namespace']=namespace
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment