Patchwork D12314: stringutil: remove Python 2 support code

login
register
mail settings
Submitter phabricator
Date March 2, 2022, 11:32 p.m.
Message ID <differential-rev-PHID-DREV-knyvud4oai7erjiu6eif-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50653/
State New
Headers show

Comments

phabricator - March 2, 2022, 11:32 p.m.
indygreg created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D12314

AFFECTED FILES
  mercurial/utils/stringutil.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/utils/stringutil.py b/mercurial/utils/stringutil.py
--- a/mercurial/utils/stringutil.py
+++ b/mercurial/utils/stringutil.py
@@ -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'))