From 45a11b974ec3f7bc3e9ff51287bb3c36721823be Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Thu, 27 Sep 2018 21:19:02 +0100 Subject: [PATCH] Update `parse_multipart` return type to support Python 3.7 (#2474) * Add encoding and errors parameters to cgi.parse_multipart stub. --- stdlib/2and3/cgi.pyi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stdlib/2and3/cgi.pyi b/stdlib/2and3/cgi.pyi index e8a9fd924753..045c0ce67843 100644 --- a/stdlib/2and3/cgi.pyi +++ b/stdlib/2and3/cgi.pyi @@ -7,7 +7,10 @@ def parse(fp: IO[Any] = ..., environ: Mapping[str, str] = ..., keep_blank_values: bool = ..., strict_parsing: bool = ...) -> Dict[str, List[str]]: ... def parse_qs(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> Dict[str, List[str]]: ... def parse_qsl(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> Dict[str, List[str]]: ... -def parse_multipart(fp: IO[Any], pdict: Mapping[str, bytes]) -> Dict[str, List[bytes]]: ... +if sys.version_info >= (3, 7): + def parse_multipart(fp: IO[Any], pdict: Mapping[str, bytes], encoding: str = ..., errors: str = ...) -> Dict[str, List[Any]]: ... +else: + def parse_multipart(fp: IO[Any], pdict: Mapping[str, bytes]) -> Dict[str, List[bytes]]: ... def parse_header(s: str) -> Tuple[str, Dict[str, str]]: ... def test(environ: Mapping[str, str] = ...) -> None: ... def print_environ(environ: Mapping[str, str] = ...) -> None: ...