Bug 1670169 - Fix hack from bug 914563 when python gets more arguments somehow. r=firefox-build-system-reviewers,rstewart DONTBUILD

Some recent change apparently made the multiprocessing code reenter
python with the arguments `-s -c "..."` instead of `-c "..."`, which
broke the assumption of the hack.

Differential Revision: https://phabricator.services.mozilla.com/D93060
This commit is contained in:
Mike Hommey 2020-10-09 14:27:28 +00:00
Родитель 4bf7a105cc
Коммит 5a6250bf22
1 изменённых файлов: 4 добавлений и 1 удалений

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

@ -1453,7 +1453,10 @@ def patch_main():
"main_module_name = '%s'\n" % main_module_name +
''.join(x[12:] for x in fork_code[1:]))
cmdline = orig_command_line()
cmdline[2] = fork_string
# We don't catch errors if "-c" is not found because it's not clear
# what we should do if the original command line is not of the form
# "python ... -c 'script'".
cmdline[cmdline.index('-c') + 1] = fork_string
return cmdline
orig_command_line = forking.get_command_line
forking.get_command_line = my_get_command_line