Commit f09c0359 authored by Brett Cannon's avatar Brett Cannon

Issue #22834: Fix a failing test under Solaris due to the platform not

allowing the deletion of the cwd.

Thanks to Martin Panter for the initial fix.
parent 061f8a31
......@@ -163,8 +163,14 @@ class FinderTests:
def test_deleted_cwd(self):
# Issue #22834
self.addCleanup(os.chdir, os.getcwd())
with tempfile.TemporaryDirectory() as path:
os.chdir(path)
try:
with tempfile.TemporaryDirectory() as path:
os.chdir(path)
except OSError as exc:
if exc.errno == 22:
# issue #22834
self.skipTest("platform does not allow the deletion of the cwd")
raise
with util.import_state(path=['']):
# Do not want FileNotFoundError raised.
self.assertIsNone(self.machinery.PathFinder.find_spec('whatever'))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment