diff -r e1953a34c110 -r 8147abc05794 mercurial/utils/procutil.py --- a/mercurial/utils/procutil.py Wed Dec 07 20:12:23 2022 +0100 +++ b/mercurial/utils/procutil.py Fri Nov 25 18:39:47 2022 -0500 @@ -18,6 +18,10 @@ import threading import time +from typing import ( + BinaryIO, +) + from ..i18n import _ from ..pycompat import ( getattr, @@ -29,6 +33,7 @@ error, policy, pycompat, + typelib, ) # Import like this to keep import-checker happy @@ -118,8 +123,8 @@ return stream -class WriteAllWrapper: - def __init__(self, orig): +class WriteAllWrapper(typelib.BinaryIO_Proxy): + def __init__(self, orig: BinaryIO): self.orig = orig def __getattr__(self, attr):