summaryrefslogtreecommitdiff
path: root/Tools/i18n
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2012-11-09 11:46:19 +0100
committerEzio Melotti <ezio.melotti@gmail.com>2012-11-09 11:46:19 +0100
commit5574199e3993468a686ddaced6b19e5453dd9cdc (patch)
tree139720ae2751bf0ffa745470c9c4146c155ed828 /Tools/i18n
parent395b24a68c33987b19c3cffa0c6839fd039e9029 (diff)
downloadcpython-5574199e3993468a686ddaced6b19e5453dd9cdc.tar.gz
#13301: use ast.literal_eval() instead of eval() in Tools/i18n/msgfmt.py. Patch by Serhiy Storchaka.
Diffstat (limited to 'Tools/i18n')
-rwxr-xr-xTools/i18n/msgfmt.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Tools/i18n/msgfmt.py b/Tools/i18n/msgfmt.py
index a5544424e2..7b3a81ff93 100755
--- a/Tools/i18n/msgfmt.py
+++ b/Tools/i18n/msgfmt.py
@@ -24,8 +24,9 @@ Options:
Display version information and exit.
"""
-import sys
import os
+import sys
+import ast
import getopt
import struct
import array
@@ -180,8 +181,7 @@ def make(filename, outfile):
l = l.strip()
if not l:
continue
- # XXX: Does this always follow Python escape semantics?
- l = eval(l)
+ l = ast.literal_eval(l)
if section == ID:
msgid += l.encode(encoding)
elif section == STR: