Patchwork D7532: windows: fix an issue causing registry config paths to be ignored on py3

login
register
mail settings
Submitter phabricator
Date Nov. 30, 2019, 7:14 a.m.
Message ID <differential-rev-PHID-DREV-n6l4x7usrof36psd43eh-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/43542/
State Superseded
Headers show

Comments

phabricator - Nov. 30, 2019, 7:14 a.m.
mharbison72 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  `util.lookupreg()` returns bytes.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/scmwindows.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/scmwindows.py b/mercurial/scmwindows.py
--- a/mercurial/scmwindows.py
+++ b/mercurial/scmwindows.py
@@ -37,7 +37,7 @@ 
     value = util.lookupreg(
         b'SOFTWARE\\Mercurial', None, winreg.HKEY_LOCAL_MACHINE
     )
-    if not isinstance(value, str) or not value:
+    if not isinstance(value, bytes) or not value:
         return rcpath
     value = util.localpath(value)
     for p in value.split(pycompat.ospathsep):