changeset 48829:fef4198c855c

setup: inline os.fsdecode now that we're done with Python 2 Differential Revision: https://phab.mercurial-scm.org/D12273
author Augie Fackler <augie@google.com>
date Wed, 02 Mar 2022 10:12:17 -0500
parents 40a65f5594f5
children 3491c450dcae
files setup.py
diffstat 1 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/setup.py	Wed Mar 02 10:11:37 2022 -0500
+++ b/setup.py	Wed Mar 02 10:12:17 2022 -0500
@@ -741,12 +741,9 @@
 
                 # Copy the pythonXY.dll next to the binary so that it runs
                 # without tampering with PATH.
-                fsdecode = lambda x: x
-                if sys.version_info[0] >= 3:
-                    fsdecode = os.fsdecode
                 dest = os.path.join(
                     os.path.dirname(self.hgtarget),
-                    fsdecode(dllbasename),
+                    os.fsdecode(dllbasename),
                 )
 
                 if not os.path.exists(dest):
@@ -756,7 +753,7 @@
                 # TODO: also handle the MSYS flavor
                 if sys.version_info[0] >= 3:
                     python_x = os.path.join(
-                        os.path.dirname(fsdecode(buf.value)),
+                        os.path.dirname(os.fsdecode(buf.value)),
                         "python3.dll",
                     )