Skip to content

Commit

Permalink
Added code that will reveal bugs in calls to namespace().
Browse files Browse the repository at this point in the history
  • Loading branch information
hathawsh committed Jul 5, 2000
1 parent 4e7ee2e commit 9528650
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 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.68 2000/06/29 14:34:19 shane Exp $'''
__version__='$Revision: 1.68 $'[11:-2]
'''$Id: DT_Util.py,v 1.69 2000/07/05 15:52:55 shane Exp $'''
__version__='$Revision: 1.69 $'[11:-2]

import regex, string, math, os
from string import strip, join, atoi, lower, split, find
Expand Down Expand Up @@ -256,9 +256,13 @@ def obsolete_attr(self, inst, name, md):
# __allow_access_to_unprotected_subobjects__=1

def namespace(self, **kw):
"""Create a tuple consisting of a single instance whos attributes are
"""Create a tuple consisting of a single instance whose attributes are
provided as keyword arguments."""
# NOTE: the self argument needs to be a TemplateDict instance.
if type(self) != TemplateDict:
raise TypeError,'''A call was made to DT_Util.namespace() with an
incorrect "self" argument. It could be caused by a product which
is not yet compatible with this version of Zope. The traceback
information may contain more details.'''
return apply(self, (), kw)

d['namespace']=namespace
Expand Down

0 comments on commit 9528650

Please sign in to comment.