1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-25 00:11:28 +00:00

make interrupting less jank by making child processes ignore sigint

This commit is contained in:
Dragorn421 2025-02-18 17:30:00 +01:00
parent 9765bd2561
commit c3cc5d324a
No known key found for this signature in database
GPG key ID: 381AEBAF3D429335

View file

@ -302,6 +302,14 @@ def process_pool_wrapped(extraction_ctx, pd):
) from e ) from e
# Make interrupting jobs with ^C less jank
# https://stackoverflow.com/questions/72967793/keyboardinterrupt-with-python-multiprocessing-pool
def set_sigint_ignored():
import signal
signal.signal(signal.SIGINT, signal.SIG_IGN)
def main(): def main():
import argparse import argparse
import json import json
@ -444,7 +452,9 @@ def main():
pools_desc_to_extract = pools_desc_modified pools_desc_to_extract = pools_desc_modified
if pools_desc_to_extract: if pools_desc_to_extract:
with multiprocessing.Pool(processes=args.jobs) as pool: with multiprocessing.Pool(
processes=args.jobs, initializer=set_sigint_ignored
) as pool:
jobs = [ jobs = [
( (
pd, pd,