Skip to content

Commit df45287

Browse files
authored
[wave] Accept more file argument types in Python 3.15+ (#15824)
1 parent b4566fb commit df45287

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

stdlib/wave.pyi

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
import sys
2-
from _typeshed import ReadableBuffer, Unused
2+
from _typeshed import ReadableBuffer, StrOrBytesPath, Unused
33
from typing import IO, Any, BinaryIO, Final, Literal, NamedTuple, NoReturn, TypeAlias, overload
44
from typing_extensions import Self, deprecated
55

66
__all__ = ["open", "Error", "Wave_read", "Wave_write"]
77
if sys.version_info >= (3, 15):
88
__all__ += ["WAVE_FORMAT_PCM", "WAVE_FORMAT_IEEE_FLOAT", "WAVE_FORMAT_EXTENSIBLE"]
99

10-
_File: TypeAlias = str | IO[bytes]
10+
if sys.version_info >= (3, 15):
11+
_File: TypeAlias = StrOrBytesPath | IO[bytes]
12+
else:
13+
_File: TypeAlias = str | IO[bytes]
1114

1215
class Error(Exception): ...
1316

0 commit comments

Comments
 (0)