From: Barry Warsaw Date: Sat, 4 Oct 2003 02:28:31 +0000 (+0000) Subject: GNUTranslations._parse(): Initialize local variable k so that if the X-Git-Tag: v2.4a1~1466 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b8c787606cfd5bbef2e826ee854f424483e814e2;p=python GNUTranslations._parse(): Initialize local variable k so that if the first line of a header section isn't an RFC-ish header, it's just ignored instead of throwing an UnboundLocalError. Backport candidate. --- diff --git a/Lib/gettext.py b/Lib/gettext.py index 6c8a7df76d..ed9d3ea990 100644 --- a/Lib/gettext.py +++ b/Lib/gettext.py @@ -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: