From b8b656b437be56c443533389946072407f754f3c Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Sat, 16 May 2020 16:56:40 -0700 Subject: [PATCH] Import builtins._PathLike instead of os.PathLike in genericpath. (#4013) os imports genericpath, so genericpath importing os creates a circular import that confuses pytype. --- stdlib/2and3/genericpath.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/2and3/genericpath.pyi b/stdlib/2and3/genericpath.pyi index aba0788a5..267900c90 100644 --- a/stdlib/2and3/genericpath.pyi +++ b/stdlib/2and3/genericpath.pyi @@ -6,8 +6,8 @@ if sys.version_info >= (3, 0): else: def commonprefix(m: Sequence[AnyStr]) -> AnyStr: ... if sys.version_info >= (3, 6): - from os import PathLike - def exists(path: Union[AnyStr, PathLike[AnyStr]]) -> bool: ... + from builtins import _PathLike + def exists(path: Union[AnyStr, _PathLike[AnyStr]]) -> bool: ... else: def exists(path: Text) -> bool: ... def isfile(path: Text) -> bool: ...