diff options
| author | Tim Graham <timograham@gmail.com> | 2017-03-18 10:01:42 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-03-20 11:35:46 -0400 |
| commit | 0c6c859d4edf6e462d000da21b4fa5009cb2696f (patch) | |
| tree | 276b80b88fb0fcb226512290a47dbc9ed4d3324a | |
| parent | 2867b7eb4b8477710f11707d4b975db10e5f91a7 (diff) | |
Fixed #27890 -- Fixed FileNotFoundError cleanup exception in runtests.py on Python 3.6+.
| -rwxr-xr-x | tests/runtests.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/runtests.py b/tests/runtests.py index 4cb36049fd..226ae96ca7 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -217,6 +217,12 @@ def teardown(state): # Restore the old settings. for key, value in state.items(): setattr(settings, key, value) + # Discard the multiprocessing.util finalizer that tries to remove a + # temporary directory that's already removed by this script's + # atexit.register(shutil.rmtree, TMPDIR) handler. Prevents + # FileNotFoundError at the end of a test run on Python 3.6+ (#27890). + from multiprocessing.util import _finalizer_registry + _finalizer_registry.pop((-100, 0), None) def actual_test_processes(parallel): |
