mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-23 12:21:27 +08:00
- Add support for PathLike to _PathType for Python 3.6 Unions only (#1165)
This commit is contained in:
committed by
Łukasz Langa
parent
55dc338bbf
commit
6e1d915944
@@ -118,7 +118,7 @@ TMP_MAX = 0 # Undocumented, but used by tempfile
|
||||
if sys.version_info >= (3, 6):
|
||||
from builtins import _PathLike as PathLike # See comment in builtins
|
||||
|
||||
_PathType = Union[bytes, Text]
|
||||
_PathType = path._PathType
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
class DirEntry(PathLike[AnyStr]):
|
||||
|
||||
@@ -10,7 +10,12 @@ from typing import (
|
||||
)
|
||||
|
||||
_T = TypeVar('_T')
|
||||
_PathType = Union[bytes, Text]
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
from builtins import _PathLike
|
||||
_PathType = Union[bytes, Text, _PathLike]
|
||||
else:
|
||||
_PathType = Union[bytes, Text]
|
||||
|
||||
# ----- os.path variables -----
|
||||
supports_unicode_filenames = False
|
||||
|
||||
Reference in New Issue
Block a user