From e8d0cadf7b1a14a32d0d99b4cc825f11afc21c7b Mon Sep 17 00:00:00 2001 From: Shantanu Date: Wed, 27 May 2020 21:42:32 -0700 Subject: [PATCH] aifc: update for py39 (#4126) Co-authored-by: hauntsaninja <> --- stdlib/2and3/aifc.pyi | 13 +++++++------ tests/stubtest_whitelists/py39.txt | 1 - 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/stdlib/2and3/aifc.pyi b/stdlib/2and3/aifc.pyi index 61e31a9ed..696ae4c52 100644 --- a/stdlib/2and3/aifc.pyi +++ b/stdlib/2and3/aifc.pyi @@ -77,9 +77,10 @@ def open(f: _File, mode: Literal["w", "wb"]) -> Aifc_write: ... @overload def open(f: _File, mode: Optional[str] = ...) -> Any: ... -@overload -def openfp(f: _File, mode: Literal["r", "rb"]) -> Aifc_read: ... -@overload -def openfp(f: _File, mode: Literal["w", "wb"]) -> Aifc_write: ... -@overload -def openfp(f: _File, mode: Optional[str] = ...) -> Any: ... +if sys.version_info < (3, 9): + @overload + def openfp(f: _File, mode: Literal["r", "rb"]) -> Aifc_read: ... + @overload + def openfp(f: _File, mode: Literal["w", "wb"]) -> Aifc_write: ... + @overload + def openfp(f: _File, mode: Optional[str] = ...) -> Any: ... diff --git a/tests/stubtest_whitelists/py39.txt b/tests/stubtest_whitelists/py39.txt index 67098c1aa..89013a4e1 100644 --- a/tests/stubtest_whitelists/py39.txt +++ b/tests/stubtest_whitelists/py39.txt @@ -3,7 +3,6 @@ _dummy_thread _thread.ExceptHookArgs _thread._ExceptHookArgs _weakref.getweakrefcount -aifc.openfp array.array.fromstring array.array.tostring ast.Bytes.__new__