[Python-3000-checkins] r53738 - in python/branches/p3yk/Lib: test/test_sax.py xml/sax/xmlreader.py

guido.van.rossum python-3000-checkins at python.org
Sun Feb 11 19:44:57 CET 2007


Author: guido.van.rossum
Date: Sun Feb 11 19:44:55 2007
New Revision: 53738

Modified:
   python/branches/p3yk/Lib/test/test_sax.py
   python/branches/p3yk/Lib/xml/sax/xmlreader.py
Log:
Make test_sax pass.


Modified: python/branches/p3yk/Lib/test/test_sax.py
==============================================================================
--- python/branches/p3yk/Lib/test/test_sax.py	(original)
+++ python/branches/p3yk/Lib/test/test_sax.py	Sun Feb 11 19:44:55 2007
@@ -358,11 +358,11 @@
            (attrs.getQNames() == [] or attrs.getQNames() == ["ns:attr"]) and \
            len(attrs) == 1 and \
            (ns_uri, "attr") in attrs and \
-           attrs.keys() == [(ns_uri, "attr")] and \
+           list(attrs.keys()) == [(ns_uri, "attr")] and \
            attrs.get((ns_uri, "attr")) == "val" and \
            attrs.get((ns_uri, "attr"), 25) == "val" and \
-           attrs.items() == [((ns_uri, "attr"), "val")] and \
-           attrs.values() == ["val"] and \
+           list(attrs.items()) == [((ns_uri, "attr"), "val")] and \
+           list(attrs.values()) == ["val"] and \
            attrs.getValue((ns_uri, "attr")) == "val" and \
            attrs[(ns_uri, "attr")] == "val"
 
@@ -698,7 +698,7 @@
     # Bug report: http://www.python.org/sf/1511497
     import sys
     old_modules = sys.modules.copy()
-    for modname in sys.modules.keys():
+    for modname in list(sys.modules.keys()):
         if modname.startswith("xml."):
             del sys.modules[modname]
     try:
@@ -734,8 +734,7 @@
     outf.write(result.getvalue())
     outf.close()
 
-items = locals().items()
-items.sort()
+items = sorted(locals().items())
 for (name, value) in items:
     if name[ : 5] == "test_":
         confirm(value(), name)

Modified: python/branches/p3yk/Lib/xml/sax/xmlreader.py
==============================================================================
--- python/branches/p3yk/Lib/xml/sax/xmlreader.py	(original)
+++ python/branches/p3yk/Lib/xml/sax/xmlreader.py	Sun Feb 11 19:44:55 2007
@@ -304,10 +304,10 @@
         return name
 
     def getNames(self):
-        return self._attrs.keys()
+        return list(self._attrs.keys())
 
     def getQNames(self):
-        return self._attrs.keys()
+        return list(self._attrs.keys())
 
     def __len__(self):
         return len(self._attrs)
@@ -316,7 +316,7 @@
         return self._attrs[name]
 
     def keys(self):
-        return self._attrs.keys()
+        return list(self._attrs.keys())
 
     def __contains__(self, name):
         return name in self._attrs
@@ -328,10 +328,10 @@
         return self.__class__(self._attrs)
 
     def items(self):
-        return self._attrs.items()
+        return list(self._attrs.items())
 
     def values(self):
-        return self._attrs.values()
+        return list(self._attrs.values())
 
 # ===== ATTRIBUTESNSIMPL =====
 
@@ -363,7 +363,7 @@
         return self._qnames[name]
 
     def getQNames(self):
-        return self._qnames.values()
+        return list(self._qnames.values())
 
     def copy(self):
         return self.__class__(self._attrs, self._qnames)


More information about the Python-3000-checkins mailing list