summaryrefslogtreecommitdiffstats
path: root/Tools/i18n
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2012-11-09 10:46:19 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2012-11-09 10:46:19 (GMT)
commit9bf379e9fbbd669cfbf61adc6b833a9bbe023238 (patch)
treed451a0bffa3afc9367090354a54eda1dd169bd03 /Tools/i18n
parent8b6b176b33ee8c3074b463a4628faa84dea0ebed (diff)
downloadcpython-9bf379e9fbbd669cfbf61adc6b833a9bbe023238.zip
cpython-9bf379e9fbbd669cfbf61adc6b833a9bbe023238.tar.gz
cpython-9bf379e9fbbd669cfbf61adc6b833a9bbe023238.tar.bz2
#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 a554442..7b3a81f 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: