Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 08e544e

Browse files
committed
Issue #12333: fix test_distutils failures under Solaris and derivatives
1 parent b0993bc commit 08e544e

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Lib/distutils/tests/support.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,13 @@ class TempdirManager(object):
5454

5555
def setUp(self):
5656
super().setUp()
57+
self.old_cwd = os.getcwd()
5758
self.tempdirs = []
5859

5960
def tearDown(self):
61+
# Restore working dir, for Solaris and derivatives, where rmdir()
62+
# on the current directory fails.
63+
os.chdir(self.old_cwd)
6064
super().tearDown()
6165
while self.tempdirs:
6266
d = self.tempdirs.pop()

0 commit comments

Comments
 (0)