mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-10-09 14:55:50 +08:00
- Add support for PathLike to _PathType for Python 3.6 Unions only (#1165)
This commit is contained in:
1 parent
55dc338bbf
commit
6e1d915944
2 files changed
+7
-2
No files matched your search
@@ -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