# HG changeset patch # User Gregory Szorc # Date 1645465989 25200 # Node ID 46b3ecfb16e2781ede9752d972dc22f0e1dfea87 # Parent 3681b4c56618b60ff1fdcc6332385589b0d64092 stringutil: remove Python 2 support code Differential Revision: https://phab.mercurial-scm.org/D12314 diff -r 3681b4c56618 -r 46b3ecfb16e2 mercurial/utils/stringutil.py --- a/mercurial/utils/stringutil.py Mon Feb 21 10:52:27 2022 -0700 +++ b/mercurial/utils/stringutil.py Mon Feb 21 10:53:09 2022 -0700 @@ -964,6 +964,4 @@ def evalpythonliteral(s): """Evaluate a string containing a Python literal expression""" # We could backport our tokenizer hack to rewrite '' to u'' if we want - if pycompat.ispy3: - return ast.literal_eval(s.decode('latin1')) - return ast.literal_eval(s) + return ast.literal_eval(s.decode('latin1'))