Skip to content
Merged
Prev Previous commit
Next Next commit
Fix a few tests, and a glaring logic error in the posixpath backport.
  • Loading branch information
Yhg1s committed Jun 3, 2025
commit 70f9db5b4006e4cf3cd2fff1c3f8262879374144
2 changes: 0 additions & 2 deletions Lib/posixpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,6 @@ def _joinrealpath(path, rest, strict, seen):
try:
st = os.lstat(newpath)
except ignored_error:
if strict:
raise
is_link = False
else:
is_link = stat.S_ISLNK(st.st_mode)
Expand Down
6 changes: 3 additions & 3 deletions Lib/test/test_posixpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,11 +601,11 @@ def test_realpath_relative(self, kwargs):
@_parameterize({}, {'strict': ALLOW_MISSING})
def test_realpath_missing_pardir(self, kwargs):
try:
os.symlink(TESTFN + "1", TESTFN)
os.symlink(os_helper.TESTFN + "1", os_helper.TESTFN)
self.assertEqual(
realpath("nonexistent/../" + TESTFN, **kwargs), ABSTFN + "1")
realpath("nonexistent/../" + os_helper.TESTFN, **kwargs), ABSTFN + "1")
finally:
os_helper.unlink(TESTFN)
os_helper.unlink(os_helper.TESTFN)

@os_helper.skip_unless_symlink
@skip_if_ABSTFN_contains_backslash
Expand Down
Loading