Skip to content

Commit

Permalink
Fixed a bug that caused dtml-try to throw a KeyError. Related to
Browse files Browse the repository at this point in the history
the recent changes made to DT_Util.namespace().
  • Loading branch information
hathawsh committed Jun 29, 2000
1 parent 16b9109 commit 153bdfd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion DT_Try.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def render_try_except(self, md):
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)
Expand Down
10 changes: 5 additions & 5 deletions DT_Util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -252,13 +252,13 @@ def obsolete_attr(self, inst, name, md):
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
Expand Down

0 comments on commit 153bdfd

Please sign in to comment.