Skip to content

Commit 3196554

Browse files
committed
Fix a few tests, and a glaring logic error in the posixpath backport.
1 parent 698a6d4 commit 3196554

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

Lib/posixpath.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,8 +459,6 @@ def _joinrealpath(path, rest, strict, seen):
459459
try:
460460
st = os.lstat(newpath)
461461
except ignored_error:
462-
if strict:
463-
raise
464462
is_link = False
465463
else:
466464
is_link = stat.S_ISLNK(st.st_mode)

Lib/test/test_posixpath.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -545,11 +545,11 @@ def test_realpath_relative(self, kwargs):
545545
@_parameterize({}, {'strict': ALLOW_MISSING})
546546
def test_realpath_missing_pardir(self, kwargs):
547547
try:
548-
os.symlink(TESTFN + "1", TESTFN)
548+
os.symlink(os_helper.TESTFN + "1", os_helper.TESTFN)
549549
self.assertEqual(
550-
realpath("nonexistent/../" + TESTFN, **kwargs), ABSTFN + "1")
550+
realpath("nonexistent/../" + os_helper.TESTFN, **kwargs), ABSTFN + "1")
551551
finally:
552-
os_helper.unlink(TESTFN)
552+
os_helper.unlink(os_helper.TESTFN)
553553

554554
@os_helper.skip_unless_symlink
555555
@skip_if_ABSTFN_contains_backslash

0 commit comments

Comments
 (0)