summaryrefslogtreecommitdiff
path: root/Lib/gettext.py
diff options
context:
space:
mode:
authorAndrew Kuchling <amk@amk.ca>2015-04-13 10:38:56 -0400
committerAndrew Kuchling <amk@amk.ca>2015-04-13 10:38:56 -0400
commit8b963c5853519533ef7188effcde9159c56780d1 (patch)
tree444217235c3ec75142940e013ef2c7978129e076 /Lib/gettext.py
parent770b08e8e2ec7aa0028f4e94e3f27f1d545aee3e (diff)
downloadcpython-git-8b963c5853519533ef7188effcde9159c56780d1.tar.gz
#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 d38fda2ef0..8caf1d1227 100644
--- a/Lib/gettext.py
+++ b/Lib/gettext.py
@@ -262,11 +262,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 b_item in tmsg.split('\n'.encode("ascii")):
item = b_item.decode().strip()
if not item:
continue
+ k = v = None
if ':' in item:
k, v = item.split(':', 1)
k = k.strip().lower()