From c6072d86758e1d199b50ecb647d81d2b12396955 Mon Sep 17 00:00:00 2001 From: Jesus Cea Date: Fri, 9 Sep 2011 18:50:59 +0200 Subject: Issue #12333: fix test_distutils failures under Solaris and derivatives. Patch by Antoine Pitrou --- Lib/distutils/tests/support.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Lib/distutils/tests/support.py b/Lib/distutils/tests/support.py index 648a8e4..a2190c0 100644 --- a/Lib/distutils/tests/support.py +++ b/Lib/distutils/tests/support.py @@ -63,9 +63,13 @@ class TempdirManager(object): def setUp(self): super(TempdirManager, self).setUp() + self.old_cwd = os.getcwd() self.tempdirs = [] def tearDown(self): + # Restore working dir, for Solaris and derivatives, where rmdir() + # on the current directory fails. + os.chdir(self.old_cwd) super(TempdirManager, self).tearDown() while self.tempdirs: d = self.tempdirs.pop() -- cgit v0.12