Skip to content

Commit

Permalink
Revert "Workaround tornado+py38+windows compatibility issue (Same as i…
Browse files Browse the repository at this point in the history
…python#456). Set eventloop policy to the old default while tornado is not compatible with the new one."

This reverts commit 06967ee.
  • Loading branch information
ericpre committed Jan 29, 2020
1 parent 06967ee commit 04455ea
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions ipykernel/ipkernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,25 +57,7 @@ def _user_ns_changed(self, name, old, new):
_sys_raw_input = Any()
_sys_eval_input = Any()

def _init_asyncio_patch(self):
if sys.platform.startswith("win") and sys.version_info >= (3, 8):
import asyncio
try:
from asyncio import (
WindowsProactorEventLoopPolicy,
WindowsSelectorEventLoopPolicy,
)
except ImportError:
pass
# not affected
else:
if type(asyncio.get_event_loop_policy()) is WindowsProactorEventLoopPolicy:
# WindowsProactorEventLoopPolicy is not compatible with tornado 6
# fallback to the pre-3.8 default of Selector
asyncio.set_event_loop_policy(WindowsSelectorEventLoopPolicy())

def __init__(self, **kwargs):
self._init_asyncio_patch()
super(IPythonKernel, self).__init__(**kwargs)

# Initialize the InteractiveShell subclass
Expand Down

0 comments on commit 04455ea

Please sign in to comment.