Patchwork D7413: py3: drop an unnecessary fsencode() before comparing with constant

login
register
mail settings
Submitter phabricator
Date Nov. 15, 2019, 3:43 a.m.
Message ID <9f5c715148b2e3c5a8f1f73afb60063e@localhost.localdomain>
Download mbox | patch
Permalink /patch/43248/
State Not Applicable
Headers show

Comments

phabricator - Nov. 15, 2019, 3:43 a.m.
Closed by commit rHG47d983f0af65: py3: drop an unnecessary fsencode() before comparing with constant (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7413?vs=18108&id=18136

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7413/new/

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

AFFECTED FILES
  mercurial/utils/procutil.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers, indygreg
Cc: mercurial-devel

Patch

diff --git a/mercurial/utils/procutil.py b/mercurial/utils/procutil.py
--- a/mercurial/utils/procutil.py
+++ b/mercurial/utils/procutil.py
@@ -288,10 +288,7 @@ 
                 _sethgexecutable(pycompat.sysexecutable)
         elif (
             not pycompat.iswindows
-            and os.path.basename(
-                pycompat.fsencode(getattr(mainmod, '__file__', ''))
-            )
-            == b'hg'
+            and os.path.basename(getattr(mainmod, '__file__', '')) == 'hg'
         ):
             _sethgexecutable(pycompat.fsencode(mainmod.__file__))
         else: