From: Georg Brandl Date: Sat, 6 Feb 2010 23:34:10 +0000 (+0000) Subject: Fix more unbound locals in code paths that do not seem to be used. X-Git-Tag: v2.7a4~247 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cd4a21bb8ea184c32d33d534d42bc08b57b405fb;p=python Fix more unbound locals in code paths that do not seem to be used. --- diff --git a/Lib/test/test_cfgparser.py b/Lib/test/test_cfgparser.py index c7d6a94e15..fdd3c0c1c4 100644 --- a/Lib/test/test_cfgparser.py +++ b/Lib/test/test_cfgparser.py @@ -17,8 +17,9 @@ class SortedDict(UserDict.UserDict): 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()) diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py index b95438dd38..7ccb8f40c7 100644 --- a/Lib/test/test_minidom.py +++ b/Lib/test/test_minidom.py @@ -1456,12 +1456,13 @@ class MinidomTest(unittest.TestCase): 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) diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py index b51225e616..b9f1a21123 100644 --- a/Lib/test/test_platform.py +++ b/Lib/test/test_platform.py @@ -182,8 +182,10 @@ class PlatformTest(unittest.TestCase): 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):