1. Jakub Wilk
  2. i18nspector

Commits

Jakub Wilk  committed 33d5bda

lib.polib4us: use ast.literal_eval() instead of eval().

  • Participants
  • Parent commits 0737b97
  • Branches default

Comments (0)

Files changed (1)

File lib/polib4us.py

View file
 polib monkey-patching
 '''
 
+import ast
 import codecs
 import contextlib
 import inspect
     def unescape(match):
         s = match.group()
         s = _short_x_escape_re.sub(r'\x0\1', s)
-        result = eval("b'{}'".format(s))
+        result = ast.literal_eval("b'{}'".format(s))
         try:
             return result.decode('ASCII')
         except UnicodeDecodeError: