From ea2122741faa0df576094584f869e9517a1115ce Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 24 Sep 2018 16:53:44 +0200 Subject: [PATCH] os.path.exists (Py 3) accepts a file descriptor (#2451) Closes #1653 --- stdlib/2/os/path.pyi | 5 ++++- stdlib/3/os/path.pyi | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/stdlib/2/os/path.pyi b/stdlib/2/os/path.pyi index 78e21a3f9..037928c68 100644 --- a/stdlib/2/os/path.pyi +++ b/stdlib/2/os/path.pyi @@ -100,7 +100,10 @@ elif sys.version_info >= (3, 5): # So, fall back to Any def commonprefix(list: Sequence[_PathType]) -> Any: ... -def exists(path: _PathType) -> bool: ... +if sys.version_info >= (3, 3): + def exists(path: Union[_PathType, int]) -> bool: ... +else: + def exists(path: _PathType) -> bool: ... def lexists(path: _PathType) -> bool: ... # These return float if os.stat_float_times() == True, diff --git a/stdlib/3/os/path.pyi b/stdlib/3/os/path.pyi index 78e21a3f9..037928c68 100644 --- a/stdlib/3/os/path.pyi +++ b/stdlib/3/os/path.pyi @@ -100,7 +100,10 @@ elif sys.version_info >= (3, 5): # So, fall back to Any def commonprefix(list: Sequence[_PathType]) -> Any: ... -def exists(path: _PathType) -> bool: ... +if sys.version_info >= (3, 3): + def exists(path: Union[_PathType, int]) -> bool: ... +else: + def exists(path: _PathType) -> bool: ... def lexists(path: _PathType) -> bool: ... # These return float if os.stat_float_times() == True,