setup: remove printf trampoline
authorAugie Fackler <augie@google.com>
Wed, 02 Mar 2022 10:07:49 -0500
changeset 48827 1371c18e467d
parent 48826 3ce8001fd768
child 48828 40a65f5594f5
setup: remove printf trampoline Differential Revision: https://phab.mercurial-scm.org/D12271
setup.py
--- a/setup.py	Wed Mar 02 10:07:21 2022 -0500
+++ b/setup.py	Wed Mar 02 10:07:49 2022 -0500
@@ -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