Issue #12333: fix test_distutils failures under Solaris and derivatives

This commit is contained in:
Antoine Pitrou 2011-08-25 18:32:02 +02:00
parent e1eef41a18
commit 4fc80b62ba
1 changed files with 4 additions and 0 deletions

View File

@ -54,9 +54,13 @@ class TempdirManager(object):
def setUp(self): def setUp(self):
super().setUp() super().setUp()
self.old_cwd = os.getcwd()
self.tempdirs = [] self.tempdirs = []
def tearDown(self): def tearDown(self):
# Restore working dir, for Solaris and derivatives, where rmdir()
# on the current directory fails.
os.chdir(self.old_cwd)
super().tearDown() super().tearDown()
while self.tempdirs: while self.tempdirs:
d = self.tempdirs.pop() d = self.tempdirs.pop()