Skip to content

Commit 70f9db5

Browse files
committed
Fix a few tests, and a glaring logic error in the posixpath backport.
1 parent 2b5673e commit 70f9db5

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
@@ -470,8 +470,6 @@ def _joinrealpath(path, rest, strict, seen):
470470
try:
471471
st = os.lstat(newpath)
472472
except ignored_error:
473-
if strict:
474-
raise
475473
is_link = False
476474
else:
477475
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
@@ -601,11 +601,11 @@ def test_realpath_relative(self, kwargs):
601601
@_parameterize({}, {'strict': ALLOW_MISSING})
602602
def test_realpath_missing_pardir(self, kwargs):
603603
try:
604-
os.symlink(TESTFN + "1", TESTFN)
604+
os.symlink(os_helper.TESTFN + "1", os_helper.TESTFN)
605605
self.assertEqual(
606-
realpath("nonexistent/../" + TESTFN, **kwargs), ABSTFN + "1")
606+
realpath("nonexistent/../" + os_helper.TESTFN, **kwargs), ABSTFN + "1")
607607
finally:
608-
os_helper.unlink(TESTFN)
608+
os_helper.unlink(os_helper.TESTFN)
609609

610610
@os_helper.skip_unless_symlink
611611
@skip_if_ABSTFN_contains_backslash

0 commit comments

Comments
 (0)