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

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Thu Nov 14 22:17:37 UTC 2019


martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/utils/procutil.py

CHANGE DETAILS

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:



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


More information about the Mercurial-devel mailing list