summaryrefslogtreecommitdiffstats
path: root/Lib/xmllib.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-02-02 22:15:24 (GMT)
committerGuido van Rossum <guido@python.org>1999-02-02 22:15:24 (GMT)
commit2e3f7bece07f3c40f0fe1785b83dd90aea59cb34 (patch)
treec2878d677a520fe70d9ad12f44a3e666812f59fd /Lib/xmllib.py
parentdbd37dfcffccdd71dc9051c1446b6165aacd83a1 (diff)
downloadcpython-2e3f7bece07f3c40f0fe1785b83dd90aea59cb34.zip
cpython-2e3f7bece07f3c40f0fe1785b83dd90aea59cb34.tar.gz
cpython-2e3f7bece07f3c40f0fe1785b83dd90aea59cb34.tar.bz2
Fredrik Lundh fixes Sjoerd's patch...
"""Sjoerd's version stores unbound methods. that's not good enough ;-) Here's an alternative implementation of fixdict."""
Diffstat (limited to 'Lib/xmllib.py')
-rw-r--r--Lib/xmllib.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/xmllib.py b/Lib/xmllib.py
index 92b55b7..0891158 100644
--- a/Lib/xmllib.py
+++ b/Lib/xmllib.py
@@ -103,17 +103,17 @@ class XMLParser:
self.__fixclass(k)
def __fixdict(self, dict):
- for key, val in dict.items():
+ for key in dict.keys():
if key[:6] == 'start_':
- key = key[6:]
- start, end = self.elements.get(key, (None, None))
+ tag = key[6:]
+ start, end = self.elements.get(tag, (None, None))
if start is None:
- self.elements[key] = val, end
+ self.elements[tag] = getattr(self, key), end
elif key[:4] == 'end_':
- key = key[4:]
- start, end = self.elements.get(key, (None, None))
+ tag = key[4:]
+ start, end = self.elements.get(tag, (None, None))
if end is None:
- self.elements[key] = start, val
+ self.elements[tag] = start, getattr(self, key)
# Interface -- reset this instance. Loses all unprocessed data
def reset(self):