]> granicus.if.org Git - python/commitdiff
Issue #12333: fix test_distutils failures under Solaris and derivatives
authorAntoine Pitrou <solipsis@pitrou.net>
Thu, 25 Aug 2011 16:32:02 +0000 (18:32 +0200)
committerAntoine Pitrou <solipsis@pitrou.net>
Thu, 25 Aug 2011 16:32:02 +0000 (18:32 +0200)
Lib/distutils/tests/support.py

index dc0e660e695be356e9d504ad4ac84dc58327cb6a..44fcd6b7d8441800b747b2343824eb0b8a3e5a5f 100644 (file)
@@ -54,9 +54,13 @@ class TempdirManager(object):
 
     def setUp(self):
         super().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().tearDown()
         while self.tempdirs:
             d = self.tempdirs.pop()