Patchwork D7412: py3: use native string as fallback value for __file__ for consistency

login
register
mail settings
Submitter phabricator
Date Nov. 14, 2019, 10:17 p.m.
Message ID <differential-rev-PHID-DREV-6xpmz6l3xmqdfm3a56ma-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/43221/
State Superseded
Headers show

Comments

phabricator - Nov. 14, 2019, 10:17 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This is not a bugfix (pycommpat.fsencode(b'') is a no-op on py3), but
  the b'' value was inconsistent and confusing.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/utils/procutil.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
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
@@ -289,7 +289,7 @@ 
         elif (
             not pycompat.iswindows
             and os.path.basename(
-                pycompat.fsencode(getattr(mainmod, '__file__', b''))
+                pycompat.fsencode(getattr(mainmod, '__file__', ''))
             )
             == b'hg'
         ):