From d43cea947ff2559954a52a4e7b550610fe4592d6 Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Fri, 4 Oct 2019 14:19:36 -0700 Subject: [PATCH] Fix the signature of IOBase._checkClosed(). * In Python 2, the optional `msg` argument was missing. * In Python 3, the method was missing altogether. Reference: https://github.com/python/cpython/blob/2.7/Lib/_pyio.py#L423 https://github.com/python/cpython/blob/3.6/Lib/_pyio.py#L443 --- stdlib/2/_io.pyi | 2 +- stdlib/3/io.pyi | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/stdlib/2/_io.pyi b/stdlib/2/_io.pyi index d0185ae7da0c..e8e448f2c8ed 100644 --- a/stdlib/2/_io.pyi +++ b/stdlib/2/_io.pyi @@ -16,7 +16,7 @@ _T = TypeVar("_T") class _IOBase(BinaryIO): @property def closed(self) -> bool: ... - def _checkClosed(self) -> None: ... + def _checkClosed(self, msg: Optional[str] = ...) -> None: ... # undocumented def _checkReadable(self) -> None: ... def _checkSeekable(self) -> None: ... def _checkWritable(self) -> None: ... diff --git a/stdlib/3/io.pyi b/stdlib/3/io.pyi index acab18ca179c..22a8784a755e 100644 --- a/stdlib/3/io.pyi +++ b/stdlib/3/io.pyi @@ -45,6 +45,7 @@ class IOBase: def __del__(self) -> None: ... @property def closed(self) -> bool: ... + def _checkClosed(self, msg: Optional[str] = ...) -> None: ... # undocumented class RawIOBase(IOBase): def readall(self) -> bytes: ...