mercurial/windows.py
changeset 43768 fe73ec69350e
parent 43506 9f70512ae2cf
child 43787 be8552f25cab
--- a/mercurial/windows.py	Sat Nov 23 16:54:59 2019 -0800
+++ b/mercurial/windows.py	Fri Nov 22 23:55:57 2019 -0500
@@ -26,11 +26,12 @@
 )
 
 try:
-    import _winreg as winreg
+    import _winreg as winreg  # pytype: disable=import-error
 
     winreg.CloseKey
 except ImportError:
-    import winreg
+    # py2 only
+    import winreg  # pytype: disable=import-error
 
 osutil = policy.importmod('osutil')
 
@@ -282,7 +283,7 @@
     # fileno(), usually set to -1.
     fno = getattr(fd, 'fileno', None)
     if fno is not None and fno() >= 0:
-        msvcrt.setmode(fno(), os.O_BINARY)
+        msvcrt.setmode(fno(), os.O_BINARY)  # pytype: disable=module-attr
 
 
 def pconvert(path):