From 61c5667b3fc1c4d298c41ecc33a38c5d95ffd706 Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Mon, 7 Dec 2020 14:27:56 -0800 Subject: [PATCH] Fix a Python 2 annotation in shlex. (#4805) https://github.com/python/cpython/blob/8d21aa21f2cbc6d50aab3f420bb23be1d081dac4/Lib/shlex.py#L24 suggests instream can be a string as well. --- stdlib/2/shlex.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/2/shlex.pyi b/stdlib/2/shlex.pyi index 4d59f24db..37c667238 100644 --- a/stdlib/2/shlex.pyi +++ b/stdlib/2/shlex.pyi @@ -1,11 +1,11 @@ -from typing import IO, Any, List, Optional, TypeVar +from typing import IO, Any, List, Optional, Text, TypeVar, Union def split(s: Optional[str], comments: bool = ..., posix: bool = ...) -> List[str]: ... _SLT = TypeVar("_SLT", bound=shlex) class shlex: - def __init__(self, instream: IO[Any] = ..., infile: IO[Any] = ..., posix: bool = ...) -> None: ... + def __init__(self, instream: Union[IO[Any], Text] = ..., infile: IO[Any] = ..., posix: bool = ...) -> None: ... def __iter__(self: _SLT) -> _SLT: ... def next(self) -> str: ... def get_token(self) -> Optional[str]: ...