Commits

Jakub Wilk committed 33d5bda

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

Comments (0)

Files changed (1)

 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: