From 5b730d4ded6ecf4f72ebe28769e18efb3bdc8996 Mon Sep 17 00:00:00 2001 From: hatal175 Date: Wed, 24 Mar 2021 05:56:47 +0200 Subject: [PATCH] Fix Shlex stubtest errors (#5135) --- stdlib/shlex.pyi | 6 +++--- tests/stubtest_whitelists/py3_common.txt | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/stdlib/shlex.pyi b/stdlib/shlex.pyi index 0eb89d33c..741f516dc 100644 --- a/stdlib/shlex.pyi +++ b/stdlib/shlex.pyi @@ -28,7 +28,7 @@ class shlex(Iterable[str]): punctuation_chars: str def __init__( self, - instream: Union[str, TextIO] = ..., + instream: Optional[Union[str, TextIO]] = ..., infile: Optional[str] = ..., posix: bool = ..., punctuation_chars: Union[bool, str] = ..., @@ -36,10 +36,10 @@ class shlex(Iterable[str]): def get_token(self) -> str: ... def push_token(self, tok: str) -> None: ... def read_token(self) -> str: ... - def sourcehook(self, filename: str) -> Tuple[str, TextIO]: ... + def sourcehook(self, newfile: str) -> Tuple[str, TextIO]: ... # TODO argument types def push_source(self, newstream: Any, newfile: Any = ...) -> None: ... def pop_source(self) -> None: ... - def error_leader(self, infile: str = ..., lineno: int = ...) -> None: ... + def error_leader(self, infile: Optional[str] = ..., lineno: Optional[int] = ...) -> None: ... def __iter__(self: _SLT) -> _SLT: ... def __next__(self) -> str: ... diff --git a/tests/stubtest_whitelists/py3_common.txt b/tests/stubtest_whitelists/py3_common.txt index 42dabd8ef..005672a57 100644 --- a/tests/stubtest_whitelists/py3_common.txt +++ b/tests/stubtest_whitelists/py3_common.txt @@ -331,9 +331,6 @@ sched.Event.__doc__ select.poll selectors.DevpollSelector selectors.KqueueSelector -shlex.shlex.__init__ -shlex.shlex.error_leader -shlex.shlex.sourcehook shutil.register_unpack_format signal.SIGEMT signal.SIGINFO