setup: inline encoding constant that is only used once
authorAugie Fackler <augie@google.com>
Wed, 02 Mar 2022 10:11:37 -0500
changeset 48828 40a65f5594f5
parent 48827 1371c18e467d
child 48829 fef4198c855c
setup: inline encoding constant that is only used once This was variable back when we supported Python 2. Differential Revision: https://phab.mercurial-scm.org/D12272
setup.py
--- a/setup.py	Wed Mar 02 10:07:49 2022 -0500
+++ b/setup.py	Wed Mar 02 10:11:37 2022 -0500
@@ -22,8 +22,6 @@
 import sys, platform
 import sysconfig
 
-libdir_escape = 'unicode_escape'
-
 
 def sysstr(s):
     return s.decode('latin-1')
@@ -1116,7 +1114,7 @@
                 )
                 continue
 
-            data = data.replace(b'@LIBDIR@', libdir.encode(libdir_escape))
+            data = data.replace(b'@LIBDIR@', libdir.encode('unicode_escape'))
             with open(outfile, 'wb') as fp:
                 fp.write(data)