summaryrefslogtreecommitdiff
path: root/django/utils/xmlutils.py
diff options
context:
space:
mode:
authorLuke Plant <L.Plant.98@cantab.net>2006-06-03 13:37:34 +0000
committerLuke Plant <L.Plant.98@cantab.net>2006-06-03 13:37:34 +0000
commit9b86db9bf2407f408468566b3f48a8444cb66f83 (patch)
treefc92295ebab2ea79ec9dd8fc17cc34d655d3cbb5 /django/utils/xmlutils.py
parent88d215f7021ff085cc1420236a721a286e548ce4 (diff)
downloaddjango-9b86db9bf2407f408468566b3f48a8444cb66f83.tar.gz
Eliminated lots of mutable default arguments (since they are bugs
waiting to happen and are memory leaks too). git-svn-id: http://code.djangoproject.com/svn/django/trunk@3070 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/utils/xmlutils.py')
-rw-r--r--django/utils/xmlutils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/utils/xmlutils.py b/django/utils/xmlutils.py
index 6638573857..a1eb5fb753 100644
--- a/django/utils/xmlutils.py
+++ b/django/utils/xmlutils.py
@@ -5,8 +5,9 @@ Utilities for XML generation/parsing.
from xml.sax.saxutils import XMLGenerator
class SimplerXMLGenerator(XMLGenerator):
- def addQuickElement(self, name, contents=None, attrs={}):
+ def addQuickElement(self, name, contents=None, attrs=None):
"Convenience method for adding an element with no children"
+ if attrs is None: attrs = {}
self.startElement(name, attrs)
if contents is not None:
self.characters(contents)