summaryrefslogtreecommitdiffstats
path: root/Lib/xml
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-12-28 10:38:33 (GMT)
committerGeorg Brandl <georg@python.org>2010-12-28 10:38:33 (GMT)
commit90b20675bd042a3262642232f9d3e133e56a130c (patch)
treeaf001288fae979c7e718e572bcc86b68835e8343 /Lib/xml
parentff52f76019816be0fb590a294486a33cf1ee93f7 (diff)
downloadcpython-90b20675bd042a3262642232f9d3e133e56a130c.zip
cpython-90b20675bd042a3262642232f9d3e133e56a130c.tar.gz
cpython-90b20675bd042a3262642232f9d3e133e56a130c.tar.bz2
#10777: fix iteration over dict keys while mutating the dict.
Diffstat (limited to 'Lib/xml')
-rw-r--r--Lib/xml/etree/ElementTree.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/xml/etree/ElementTree.py b/Lib/xml/etree/ElementTree.py
index 53aa9e7..ba33879 100644
--- a/Lib/xml/etree/ElementTree.py
+++ b/Lib/xml/etree/ElementTree.py
@@ -1068,7 +1068,7 @@ _serialize = {
def register_namespace(prefix, uri):
if re.match("ns\d+$", prefix):
raise ValueError("Prefix format reserved for internal use")
- for k, v in _namespace_map.items():
+ for k, v in list(_namespace_map.items()):
if k == uri or v == prefix:
del _namespace_map[k]
_namespace_map[uri] = prefix