# HG changeset patch # User Gregory Szorc # Date 2014-04-20 17:06:19 # Node ID bd70dcb91af67d806c6326d028536826f85f77c2 # Parent 592b3d2616d7ebf7ac8deafb65074d49826aa7a3 run-tests: move umask into TestRunner.run() We now properly restore the umask as well, since run() tries to clean up after itself. diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -1016,9 +1016,13 @@ class TestRunner(object): 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 @@ def main(args, runner=None, parser=None) parser = parser or getparser() (options, args) = parseargs(args, parser) runner.options = options - os.umask(022) return runner.run(args)