]> granicus.if.org Git - python/commitdiff
Make both items() methods return lists; one had changed to return an
authorFred Drake <fdrake@acm.org>
Tue, 21 Oct 2003 16:45:00 +0000 (16:45 +0000)
committerFred Drake <fdrake@acm.org>
Tue, 21 Oct 2003 16:45:00 +0000 (16:45 +0000)
iterator where it probably shouldn't have.
Closes SF bug #818861.

Lib/ConfigParser.py

index 7503ba29a1d850bf0d68d58bb988033aba445b08..d98993af3315d2ec7220e15f36eb86cf8a083175 100644 (file)
@@ -542,12 +542,11 @@ class ConfigParser(RawConfigParser):
         if "__name__" in options:
             options.remove("__name__")
         if raw:
-            for option in options:
-                yield (option, d[option])
+            return [(option, d[option])
+                    for option in options]
         else:
-            for option in options:
-                yield (option,
-                       self._interpolate(section, option, d[option], d))
+            return [(option, self._interpolate(section, option, d[option], d))
+                    for option in options]
 
     def _interpolate(self, section, option, rawval, vars):
         # do the string interpolation