mercurial/utils/stringutil.py
changeset 48911 46b3ecfb16e2
parent 48875 6000f5b25c9b
child 48946 642e31cb55f0
equal deleted inserted replaced
48910:3681b4c56618 48911:46b3ecfb16e2
   962 
   962 
   963 
   963 
   964 def evalpythonliteral(s):
   964 def evalpythonliteral(s):
   965     """Evaluate a string containing a Python literal expression"""
   965     """Evaluate a string containing a Python literal expression"""
   966     # We could backport our tokenizer hack to rewrite '' to u'' if we want
   966     # We could backport our tokenizer hack to rewrite '' to u'' if we want
   967     if pycompat.ispy3:
   967     return ast.literal_eval(s.decode('latin1'))
   968         return ast.literal_eval(s.decode('latin1'))
       
   969     return ast.literal_eval(s)