aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/Lib/posixpath.py
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.com>2025-06-18 20:33:12 +0300
committershadchin <shadchin@yandex-team.com>2025-06-18 21:16:29 +0300
commit2fcfb855cd7780ab07751cc16c80a0a58168668a (patch)
tree078f7a88f8a93e87eb89e67e0f43120c0e01528f /contrib/tools/python3/Lib/posixpath.py
parent6635b88fd4c0ff9c8545c3b277eaf5debaf40b8f (diff)
downloadydb-2fcfb855cd7780ab07751cc16c80a0a58168668a.tar.gz
Update Python 3 to 3.12.11
commit_hash:0054a0810a95d3f1aa3d36410976d43e03ff7e86
Diffstat (limited to 'contrib/tools/python3/Lib/posixpath.py')
-rw-r--r--contrib/tools/python3/Lib/posixpath.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/contrib/tools/python3/Lib/posixpath.py b/contrib/tools/python3/Lib/posixpath.py
index f1e4237b3aa..90a6f545f90 100644
--- a/contrib/tools/python3/Lib/posixpath.py
+++ b/contrib/tools/python3/Lib/posixpath.py
@@ -35,7 +35,7 @@ __all__ = ["normcase","isabs","join","splitdrive","splitroot","split","splitext"
"samefile","sameopenfile","samestat",
"curdir","pardir","sep","pathsep","defpath","altsep","extsep",
"devnull","realpath","supports_unicode_filenames","relpath",
- "commonpath", "isjunction"]
+ "commonpath", "isjunction", "ALLOW_MISSING"]
def _get_sep(path):
@@ -438,6 +438,15 @@ def _joinrealpath(path, rest, strict, seen):
sep = '/'
curdir = '.'
pardir = '..'
+ getcwd = os.getcwd
+ if strict is ALLOW_MISSING:
+ ignored_error = FileNotFoundError
+ elif strict:
+ ignored_error = ()
+ else:
+ ignored_error = OSError
+
+ maxlinks = None
if isabs(rest):
rest = rest[1:]
@@ -460,9 +469,7 @@ def _joinrealpath(path, rest, strict, seen):
newpath = join(path, name)
try:
st = os.lstat(newpath)
- except OSError:
- if strict:
- raise
+ except ignored_error:
is_link = False
else:
is_link = stat.S_ISLNK(st.st_mode)