From f7213ea2a130207450771054ea17fc7df45625f2 2021-10-18 00:24:42 From: Matthias Bussonnier Date: 2021-10-18 00:24:42 Subject: [PATCH] conditional windows import --- diff --git a/IPython/core/magics/script.py b/IPython/core/magics/script.py index 99258a8..5bf6a02 100644 --- a/IPython/core/magics/script.py +++ b/IPython/core/magics/script.py @@ -11,7 +11,6 @@ import os import signal import sys import time -from asyncio import SafeChildWatcher from contextlib import contextmanager from subprocess import CalledProcessError @@ -74,6 +73,8 @@ def safe_watcher(): yield return + from asyncio import SafeChildWatcher + policy = asyncio.get_event_loop_policy() old_watcher = policy.get_child_watcher() if isinstance(old_watcher, SafeChildWatcher):