summaryrefslogtreecommitdiffstats
path: root/Lib/gettext.py
diff options
context:
space:
mode:
authorAndrew Kuchling <amk@amk.ca>2015-04-14 14:03:35 (GMT)
committerAndrew Kuchling <amk@amk.ca>2015-04-14 14:03:35 (GMT)
commit270b0586b0c13588ed6ffd86581f11235bb4d22a (patch)
treed5534e1af1412352eed83c287675c734c314a80d /Lib/gettext.py
parent2ca7bb0ba20b6e508625733a75a1c6aae61983bf (diff)
downloadcpython-270b0586b0c13588ed6ffd86581f11235bb4d22a.zip
cpython-270b0586b0c13588ed6ffd86581f11235bb4d22a.tar.gz
cpython-270b0586b0c13588ed6ffd86581f11235bb4d22a.tar.bz2
#17898: reset k and v so that the loop doesn't use an old value
Diffstat (limited to 'Lib/gettext.py')
-rw-r--r--Lib/gettext.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/gettext.py b/Lib/gettext.py
index 247f378..43202c4 100644
--- a/Lib/gettext.py
+++ b/Lib/gettext.py
@@ -296,11 +296,12 @@ class GNUTranslations(NullTranslations):
# See if we're looking at GNU .mo conventions for metadata
if mlen == 0:
# Catalog description
- lastk = k = None
+ lastk = None
for item in tmsg.splitlines():
item = item.strip()
if not item:
continue
+ k = v = None
if ':' in item:
k, v = item.split(':', 1)
k = k.strip().lower()