[Zope3-checkins] CVS: Packages/ZConfig - Substitution.py:1.6
Fred L. Drake, Jr.
fred@zope.com
Tue, 3 Dec 2002 09:37:51 -0500
Update of /cvs-repository/Packages/ZConfig
In directory cvs.zope.org:/tmp/cvs-serv28843
Modified Files:
Substitution.py
Log Message:
Be more careful in the initialization of SubstitutionError.context.
=== Packages/ZConfig/Substitution.py 1.5 => 1.6 ===
--- Packages/ZConfig/Substitution.py:1.5 Mon Dec 2 17:55:08 2002
+++ Packages/ZConfig/Substitution.py Tue Dec 3 09:37:50 2002
@@ -5,6 +5,8 @@
def __init__(self, msg, context):
self.message = msg
+ if context is not None:
+ context = context[:]
self.context = context
def __str__(self):
@@ -14,8 +16,6 @@
"""Raised when interpolation source text contains syntactical errors."""
def __init__(self, msg, context):
- if context is not None:
- context = context[:]
SubstitutionError.__init__(self, msg, context)
class SubstitutionRecursionError(SubstitutionError):
@@ -25,7 +25,7 @@
self.name = name
msg = ("recursion on %s; current context:\n%s"
% (repr(name), ", ".join(context)))
- SubstitutionError.__init__(self, msg, context[:])
+ SubstitutionError.__init__(self, msg, context)
def get(section, name, default=None):