]> granicus.if.org Git - python/commitdiff
GNUTranslations._parse(): Initialize local variable k so that if the
authorBarry Warsaw <barry@python.org>
Sat, 4 Oct 2003 02:28:31 +0000 (02:28 +0000)
committerBarry Warsaw <barry@python.org>
Sat, 4 Oct 2003 02:28:31 +0000 (02:28 +0000)
first line of a header section isn't an RFC-ish header, it's just
ignored instead of throwing an UnboundLocalError.

Backport candidate.

Lib/gettext.py

index 6c8a7df76debae2cab2c1c6f11a8fc02e4993f59..ed9d3ea990e49e4b771b1344dddb2603bddd1cf8 100644 (file)
@@ -261,7 +261,7 @@ class GNUTranslations(NullTranslations):
             # See if we're looking at GNU .mo conventions for metadata
             if mlen == 0:
                 # Catalog description
-                lastk = None
+                lastk = k = None
                 for item in tmsg.splitlines():
                     item = item.strip()
                     if not item: