From fb3947e3c9e73959317baeeb9d8aa790b5963c60 Mon Sep 17 00:00:00 2001 From: Lars Holmberg Date: Sun, 19 Nov 2023 00:01:31 +0100 Subject: [PATCH] Add workaround for python 3.8. Probably want to remove support for that soon. --- locust/main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/locust/main.py b/locust/main.py index 0ec325eba6..5a8d8b2ad5 100644 --- a/locust/main.py +++ b/locust/main.py @@ -211,8 +211,9 @@ def sigint_handler(_signal, _frame): # nothing more to do, just wait for the children to exit for child_pid in children: _, child_status = os.waitpid(child_pid, 0) - child_exit_code = os.waitstatus_to_exitcode(child_status) - exit_code = max(exit_code, child_exit_code) + if sys.version_info >= (3, 8): # dammit python 3.8... + child_exit_code = os.waitstatus_to_exitcode(child_status) + exit_code = max(exit_code, child_exit_code) sys.exit(exit_code) else: options.master = True