[Python-checkins] r78050 - in python/trunk/Lib/test: test_cfgparser.py test_minidom.py test_platform.py

georg.brandl python-checkins at python.org
Sun Feb 7 00:34:10 CET 2010


Author: georg.brandl
Date: Sun Feb  7 00:34:10 2010
New Revision: 78050

Log:
Fix more unbound locals in code paths that do not seem to be used.

Modified:
   python/trunk/Lib/test/test_cfgparser.py
   python/trunk/Lib/test/test_minidom.py
   python/trunk/Lib/test/test_platform.py

Modified: python/trunk/Lib/test/test_cfgparser.py
==============================================================================
--- python/trunk/Lib/test/test_cfgparser.py	(original)
+++ python/trunk/Lib/test/test_cfgparser.py	Sun Feb  7 00:34:10 2010
@@ -17,8 +17,9 @@
         return result
 
     def values(self):
+        # XXX never used?
         result = self.items()
-        return [i[1] for i in values]
+        return [i[1] for i in result]
 
     def iteritems(self): return iter(self.items())
     def iterkeys(self): return iter(self.keys())

Modified: python/trunk/Lib/test/test_minidom.py
==============================================================================
--- python/trunk/Lib/test/test_minidom.py	(original)
+++ python/trunk/Lib/test/test_minidom.py	Sun Feb  7 00:34:10 2010
@@ -1456,12 +1456,13 @@
                 self.confirm(len(n1.entities) == len(n2.entities)
                         and len(n1.notations) == len(n2.notations))
                 for i in range(len(n1.notations)):
+                    # XXX this loop body doesn't seem to be executed?
                     no1 = n1.notations.item(i)
                     no2 = n1.notations.item(i)
                     self.confirm(no1.name == no2.name
                             and no1.publicId == no2.publicId
                             and no1.systemId == no2.systemId)
-                    statck.append((no1, no2))
+                    stack.append((no1, no2))
                 for i in range(len(n1.entities)):
                     e1 = n1.entities.item(i)
                     e2 = n2.entities.item(i)

Modified: python/trunk/Lib/test/test_platform.py
==============================================================================
--- python/trunk/Lib/test/test_platform.py	(original)
+++ python/trunk/Lib/test/test_platform.py	Sun Feb  7 00:34:10 2010
@@ -182,8 +182,10 @@
         if os.path.isdir(sys.executable) and \
            os.path.exists(sys.executable+'.exe'):
             # Cygwin horror
-            executable = executable + '.exe'
-        res = platform.libc_ver(sys.executable)
+            executable = sys.executable + '.exe'
+        else:
+            executable = sys.executable
+        res = platform.libc_ver(executable)
 
     def test_parse_release_file(self):
 


More information about the Python-checkins mailing list