Patchwork D12271: setup: remove printf trampoline

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

Comments

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

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  setup.py

CHANGE DETAILS




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

Patch

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -22,7 +22,6 @@ 
 import sys, platform
 import sysconfig
 
-printf = eval('print')
 libdir_escape = 'unicode_escape'
 
 
@@ -51,7 +50,7 @@ 
 version enabling these features (likely this requires the OpenSSL version to
 be at least 1.0.1).
 """
-    printf(error, file=sys.stderr)
+    print(error, file=sys.stderr)
     sys.exit(1)
 
 if sys.version_info[0] >= 3:
@@ -236,8 +235,8 @@ 
         returncode, out, err = runcmd(cmd, self.env)
         err = filterhgerr(err)
         if err or returncode != 0:
-            printf("stderr from '%s':" % (' '.join(cmd)), file=sys.stderr)
-            printf(err, file=sys.stderr)
+            print("stderr from '%s':" % (' '.join(cmd)), file=sys.stderr)
+            print(err, file=sys.stderr)
             return b''
         return out
 
@@ -470,7 +469,7 @@ 
             if hgrustext != 'cpython' and hgrustext is not None:
                 if hgrustext:
                     msg = 'unknown HGWITHRUSTEXT value: %s' % hgrustext
-                    printf(msg, file=sys.stderr)
+                    print(msg, file=sys.stderr)
                 hgrustext = None
             self.rust = hgrustext is not None
             self.no_rust = not self.rust