Patchwork D12272: setup: inline encoding constant that is only used once

login
register
mail settings
Submitter phabricator
Date March 2, 2022, 3:45 p.m.
Message ID <differential-rev-PHID-DREV-dhyub6v77sgte4jlsqhm-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50611/
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.

REVISION SUMMARY
  This was variable back when we supported Python 2.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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,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)