mercurial/windows.py
changeset 49793 8147abc05794
parent 49518 805419729e11
child 49800 c43b283a19c3
--- a/mercurial/windows.py	Wed Dec 07 20:12:23 2022 +0100
+++ b/mercurial/windows.py	Fri Nov 25 18:39:47 2022 -0500
@@ -16,6 +16,10 @@
 import sys
 import winreg  # pytype: disable=import-error
 
+from typing import (
+    BinaryIO,
+)
+
 from .i18n import _
 from .pycompat import getattr
 from . import (
@@ -23,6 +27,7 @@
     error,
     policy,
     pycompat,
+    typelib,
     win32,
 )
 
@@ -208,7 +213,7 @@
     return encoding.unitolocal(pw)
 
 
-class winstdout:
+class winstdout(typelib.BinaryIO_Proxy):
     """Some files on Windows misbehave.
 
     When writing to a broken pipe, EINVAL instead of EPIPE may be raised.
@@ -217,7 +222,7 @@
     error may happen. Python 3 already works around that.
     """
 
-    def __init__(self, fp):
+    def __init__(self, fp: BinaryIO):
         self.fp = fp
 
     def __getattr__(self, key):