Allow to change multiprocessing start method via environment for testing purposes

GitOrigin-RevId: 2e0cb4c240f02a600b37e7511bdb6903a6708d1d
This commit is contained in:
Mikhail Golubev
2019-12-18 11:08:59 +00:00
committed by intellij-monorepo-bot
parent e8d5bd4376
commit abcc326dc7
+9
View File
@@ -31,6 +31,14 @@ def _enable_segfault_tracebacks():
pass
def _configure_multiprocessing():
required_start_method = os.environ.get('GENERATOR3_MULTIPROCESSING_START_METHOD')
if required_start_method:
import multiprocessing
# Available only since Python 3.4
multiprocessing.set_start_method(required_start_method)
def parse_args(gen_version):
parser = argparse.ArgumentParser(prog='generator3',
description='Generates interface skeletons (binary stubs) for binary and '
@@ -155,4 +163,5 @@ if __name__ == "__main__":
_bootstrap_sys_path()
_setup_logging()
_enable_segfault_tracebacks()
_configure_multiprocessing()
main()