xml.etree: use _typeshed (#4221)

This commit is contained in:
Jelle Zijlstra
2020-06-11 12:41:57 -07:00
committed by GitHub
parent cf3b74a0bf
commit f67ea2031a

View File

@@ -19,6 +19,7 @@ from typing import (
Union,
overload,
)
from _typeshed import AnyPath, FileDescriptor
import sys
from typing_extensions import Literal
@@ -56,11 +57,7 @@ else:
# _fixtext function in the source). Client code knows best:
_str_result_type = 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]]
_file_or_filename = Union[AnyPath, FileDescriptor, IO[Any]]
if sys.version_info >= (3, 8):
class _Writeable(Protocol):