Bug 1678663 - Swallow exceptions during shutdown of fix_stacks.py, r=bc

Under Python 3 on Windows we sometimes get an OSError which may be a
race with the process exiting. There's not much we can do about
exceptions during shutdown so just ignore them.

Differential Revision: https://phabricator.services.mozilla.com/D99434
This commit is contained in:
James Graham 2020-12-14 14:11:10 +00:00
Родитель 2e4865bd40
Коммит 6b73ec608c
1 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -67,8 +67,12 @@ def fixSymbols(
# because it is more forceful than `wait()`, and the Python docs warn
# about possible deadlocks with `wait()`.
def cleanup(fix_stacks):
fix_stacks.stdin.close()
fix_stacks.terminate()
for fn in [fix_stacks.stdin.close, fix_stacks.terminate]:
try:
fn()
except OSError:
pass
atexit.register(cleanup, fix_stacks)