mercurial/utils/stringutil.py
changeset 37681 3942bd8db8b2
parent 37619 68132a95df31
child 37749 73d0a3dd7e53
equal deleted inserted replaced
37680:e743b8524d60 37681:3942bd8db8b2
   508     return _booleans.get(s.lower(), None)
   508     return _booleans.get(s.lower(), None)
   509 
   509 
   510 def evalpythonliteral(s):
   510 def evalpythonliteral(s):
   511     """Evaluate a string containing a Python literal expression"""
   511     """Evaluate a string containing a Python literal expression"""
   512     # We could backport our tokenizer hack to rewrite '' to u'' if we want
   512     # We could backport our tokenizer hack to rewrite '' to u'' if we want
       
   513     if pycompat.ispy3:
       
   514         return ast.literal_eval(s.decode('latin1'))
   513     return ast.literal_eval(s)
   515     return ast.literal_eval(s)