run-tests: move umask into TestRunner.run()
We now properly restore the umask as well, since run() tries to clean up
after itself.
--- a/tests/run-tests.py Sun Apr 20 10:05:00 2014 -0700
+++ b/tests/run-tests.py Sun Apr 20 10:06:19 2014 -0700
@@ -1016,9 +1016,13 @@
def run(self, args):
"""Run the test suite."""
- self._checktools()
- tests = self.findtests(args)
- return self._run(tests)
+ oldmask = os.umask(022)
+ try:
+ self._checktools()
+ tests = self.findtests(args)
+ return self._run(tests)
+ finally:
+ os.umask(oldmask)
def _run(self, tests):
if self.options.random:
@@ -1459,7 +1463,6 @@
parser = parser or getparser()
(options, args) = parseargs(args, parser)
runner.options = options
- os.umask(022)
return runner.run(args)