Mercurial > public > mercurial-scm > hg
comparison setup.py @ 48828:40a65f5594f5
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
author | Augie Fackler <augie@google.com> |
---|---|
date | Wed, 02 Mar 2022 10:11:37 -0500 |
parents | 1371c18e467d |
children | fef4198c855c |
comparison
equal
deleted
inserted
replaced
48827:1371c18e467d | 48828:40a65f5594f5 |
---|---|
19 ] | 19 ] |
20 ) | 20 ) |
21 | 21 |
22 import sys, platform | 22 import sys, platform |
23 import sysconfig | 23 import sysconfig |
24 | |
25 libdir_escape = 'unicode_escape' | |
26 | 24 |
27 | 25 |
28 def sysstr(s): | 26 def sysstr(s): |
29 return s.decode('latin-1') | 27 return s.decode('latin-1') |
30 | 28 |
1114 'not rewriting @LIBDIR@ in %s because install path ' | 1112 'not rewriting @LIBDIR@ in %s because install path ' |
1115 'not known' % outfile | 1113 'not known' % outfile |
1116 ) | 1114 ) |
1117 continue | 1115 continue |
1118 | 1116 |
1119 data = data.replace(b'@LIBDIR@', libdir.encode(libdir_escape)) | 1117 data = data.replace(b'@LIBDIR@', libdir.encode('unicode_escape')) |
1120 with open(outfile, 'wb') as fp: | 1118 with open(outfile, 'wb') as fp: |
1121 fp.write(data) | 1119 fp.write(data) |
1122 | 1120 |
1123 | 1121 |
1124 # virtualenv installs custom distutils/__init__.py and | 1122 # virtualenv installs custom distutils/__init__.py and |