Skip to content
This repository was archived by the owner on Aug 25, 2024. It is now read-only.

Commit 976a614

Browse files
committed
util: cli: FastChildWatcher windows incompatibility
Fixes: #485 Signed-off-by: John Andersen <[email protected]>
1 parent bcb5d24 commit 976a614

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2121
incorrectly.
2222
- `operations_parameter_set_pairs` moved to `MemoryOrchestratorContext`
2323
- Ignore generated files in `docs/plugins/`
24+
- Windows support by selecting `asyncio.ProactorEventLoop` and not using
25+
`asyncio.FastChildWatcher`.
2426

2527
## [0.3.5] - 2020-03-10
2628
### Added

dffml/util/cli/cmd.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616

1717
DisplayHelp = "Display help message"
1818

19+
if sys.platform == "win32": # pragma: no cov
20+
asyncio.set_event_loop(asyncio.ProactorEventLoop())
21+
1922

2023
class ParseLoggingAction(argparse.Action):
2124
def __call__(self, parser, namespace, value, option_string=None):
@@ -202,7 +205,11 @@ def main(cls, loop=None, argv=sys.argv):
202205
# is the default and may cause BlockingIOErrors when many
203206
# subprocesses are created
204207
# https://docs.python.org/3/library/asyncio-policy.html#asyncio.FastChildWatcher
205-
if sys.version_info.major == 3 and sys.version_info.minor == 7:
208+
if (
209+
sys.version_info.major == 3
210+
and sys.version_info.minor == 7
211+
and sys.platform != "win32"
212+
):
206213
watcher = asyncio.FastChildWatcher()
207214
asyncio.set_child_watcher(watcher)
208215
watcher.attach_loop(loop)

0 commit comments

Comments
 (0)