diff mercurial/windows.py @ 49065:d500df2e8034

pytype: disable a few errors about Windows specific module attributes These were flagged by pytype 2022.03.21. Differential Revision: https://phab.mercurial-scm.org/D12401
author Matt Harbison <matt_harbison@yahoo.com>
date Wed, 23 Mar 2022 13:51:40 -0400
parents 642e31cb55f0
children 53e9422a9b45
line wrap: on
line diff
--- a/mercurial/windows.py	Sat Mar 19 15:44:38 2022 +0100
+++ b/mercurial/windows.py	Wed Mar 23 13:51:40 2022 -0400
@@ -676,14 +676,21 @@
     LOCAL_MACHINE).
     """
     if scope is None:
+        # pytype: disable=module-attr
         scope = (winreg.HKEY_CURRENT_USER, winreg.HKEY_LOCAL_MACHINE)
+        # pytype: enable=module-attr
     elif not isinstance(scope, (list, tuple)):
         scope = (scope,)
     for s in scope:
         try:
+            # pytype: disable=module-attr
             with winreg.OpenKey(s, encoding.strfromlocal(key)) as hkey:
+                # pytype: enable=module-attr
                 name = valname and encoding.strfromlocal(valname) or valname
+                # pytype: disable=module-attr
                 val = winreg.QueryValueEx(hkey, name)[0]
+                # pytype: enable=module-attr
+
                 # never let a Unicode string escape into the wild
                 return encoding.unitolocal(val)
         except EnvironmentError: