Support matcher decorators with multiprocessing on Windows/macOS.
See issue #1181 for more context.
Summary
Call _gather_matchers later in the code (first time when it's needed) to ensure we initialize them in a process AFTER the "fork".
Proactively check if attributes are not properties instead of trying to evaluate them and suppressing all errors.
Test Plan
Before
> hatch run python -m unittest libcst.codemod.tests.test_codemod_cli.TestCodemodCLI.test_matcher_decorators_multiprocessing
FAILED (failures=1)
After
> hatch run python -m unittest libcst.codemod.tests.test_codemod_cli.TestCodemodCLI.test_matcher_decorators_multiprocessing
.
----------------------------------------------------------------------
Ran 1 test in 0.973s
OK
Support matcher decorators with multiprocessing on Windows/macOS.
See issue #1181 for more context.
Summary
_gather_matchers
later in the code (first time when it's needed) to ensure we initialize them in a process AFTER the "fork".Test Plan
Before
After