File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1111import signal
1212import subprocess
1313import sys
14+ import platform
1415from abc import ABC
1516from collections import defaultdict
1617from configparser import (
5556import libcst as cst
5657import libcst .matchers as m
5758from rich .text import Text
58- from setproctitle import setproctitle
59+
60+ # do not import on macOS before forking, because this causes a segfault on newer versions (see #446)
61+ # on other platforms, import before forking for a small performance gain (import takes some miliseconds; re-import later on is instant)
62+ if platform .system () != 'Darwin' :
63+ from setproctitle import setproctitle
5964
6065import mutmut
6166from mutmut .code_coverage import gather_coverage , get_covered_lines_for_file
@@ -1101,6 +1106,8 @@ def read_one_child_exit_status():
11011106 if not pid :
11021107 # In the child
11031108 os .environ ['MUTANT_UNDER_TEST' ] = mutant_name
1109+ # import for macOS (on other platforms, this re-import does nothing)
1110+ from setproctitle import setproctitle
11041111 setproctitle (f'mutmut: { mutant_name } ' )
11051112
11061113 # Run fast tests first
You can’t perform that action at this time.
0 commit comments