From 22fd5e916ac0c1b3d93241777c6ef98b5eb29bef Mon Sep 17 00:00:00 2001 From: Shantanu Date: Wed, 27 May 2020 21:06:11 -0700 Subject: [PATCH] wsgiref: fix arg name, make close an instance variable (#4123) Co-authored-by: hauntsaninja <> --- stdlib/2and3/wsgiref/util.pyi | 6 +++--- tests/stubtest_whitelists/py3_common.txt | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/stdlib/2and3/wsgiref/util.pyi b/stdlib/2and3/wsgiref/util.pyi index 501ddcd5b..0382fc285 100644 --- a/stdlib/2and3/wsgiref/util.pyi +++ b/stdlib/2and3/wsgiref/util.pyi @@ -1,19 +1,19 @@ import sys -from typing import IO, Any, Optional +from typing import IO, Any, Callable, Optional from .types import WSGIEnvironment class FileWrapper: filelike: IO[bytes] blksize: int - def __init__(self, filelike: IO[bytes], bklsize: int = ...) -> None: ... + close: Callable[[], None] # only exists if filelike.close exists + def __init__(self, filelike: IO[bytes], blksize: int = ...) -> None: ... def __getitem__(self, key: Any) -> bytes: ... def __iter__(self) -> FileWrapper: ... if sys.version_info < (3,): def next(self) -> bytes: ... else: def __next__(self) -> bytes: ... - def close(self) -> None: ... # only exists if filelike.close exists def guess_scheme(environ: WSGIEnvironment) -> str: ... def application_uri(environ: WSGIEnvironment) -> str: ... diff --git a/tests/stubtest_whitelists/py3_common.txt b/tests/stubtest_whitelists/py3_common.txt index 280c9beb3..26fe84bfe 100644 --- a/tests/stubtest_whitelists/py3_common.txt +++ b/tests/stubtest_whitelists/py3_common.txt @@ -526,9 +526,7 @@ webbrowser.UnixBrowser.raise_opts webbrowser.UnixBrowser.remote_action webbrowser.UnixBrowser.remote_action_newtab webbrowser.UnixBrowser.remote_action_newwin -wsgiref.types -wsgiref.util.FileWrapper.__init__ -wsgiref.util.FileWrapper.close +wsgiref.types # Doesn't exist, see comments in file xml.etree.ElementPath._SelectorContext.parent_map xml.etree.ElementTree.Element.__bool__ xml.etree.ElementTree.Element.copy