mercurial/windows.py
changeset 49323 709e5f7eec1f
parent 49319 defc369d705e
child 49324 6b39c7265935
equal deleted inserted replaced
49322:ce50d95cfa57 49323:709e5f7eec1f
   678     for s in scope:
   678     for s in scope:
   679         try:
   679         try:
   680             # pytype: disable=module-attr
   680             # pytype: disable=module-attr
   681             with winreg.OpenKey(s, encoding.strfromlocal(key)) as hkey:
   681             with winreg.OpenKey(s, encoding.strfromlocal(key)) as hkey:
   682                 # pytype: enable=module-attr
   682                 # pytype: enable=module-attr
   683                 name = valname and encoding.strfromlocal(valname) or valname
   683                 name = None
       
   684                 if valname is not None:
       
   685                     name = encoding.strfromlocal(valname)
   684                 # pytype: disable=module-attr
   686                 # pytype: disable=module-attr
   685                 val = winreg.QueryValueEx(hkey, name)[0]
   687                 val = winreg.QueryValueEx(hkey, name)[0]
   686                 # pytype: enable=module-attr
   688                 # pytype: enable=module-attr
   687 
   689 
   688                 # never let a Unicode string escape into the wild
   690                 # never let a Unicode string escape into the wild