mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-14 23:32:22 +08:00
xml.etree.ElementTree: add support for os.PathLike for py36+ (#4097)
xml.etree.ElementTree uses open on filenames (e.g. [1]), so os.PathLike has
been supported as filenames since Python 3.6.
[1] 285ff63351/Lib/xml/etree/ElementTree.py (L584)
This commit is contained in:
@@ -63,7 +63,11 @@ else:
|
||||
# _fixtext function in the source). Client code knows best:
|
||||
_str_result_type = Any
|
||||
|
||||
_file_or_filename = Union[str, bytes, int, IO[Any]]
|
||||
if sys.version_info >= (3, 6):
|
||||
from os import PathLike
|
||||
_file_or_filename = Union[str, bytes, PathLike[str], int, IO[Any]]
|
||||
else:
|
||||
_file_or_filename = Union[str, bytes, int, IO[Any]]
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
class _Writeable(Protocol):
|
||||
|
||||
Reference in New Issue
Block a user