Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix %gui asyncio with tornado 5 #296

Merged
merged 3 commits into from
Jan 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ install:
- |
pip install --upgrade setuptools pip
pip install --pre .
# temp fix: pin tornado < 5
pip install 'tornado<5'
pip install ipykernel[test] codecov
- |
if [[ "$TRAVIS_PYTHON_VERSION" == "3.6" || "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
Expand Down
1 change: 0 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ install:
pip install ipykernel[test]
- cmd: |
pip install matplotlib numpy
pip install "tornado<5"
pip freeze
- cmd: python -c "import ipykernel.kernelspec; ipykernel.kernelspec.install(user=True)"
test_script:
Expand Down
6 changes: 4 additions & 2 deletions ipykernel/kernelbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ class Kernel(SingletonConfigurable):
def _update_eventloop(self, change):
"""schedule call to eventloop from IOLoop"""
loop = ioloop.IOLoop.current()
loop.add_callback(self.enter_eventloop)
if change.new is not None:
loop.add_callback(self.enter_eventloop)

session = Instance(Session, allow_none=True)
profile_dir = Instance('IPython.core.profiledir.ProfileDir', allow_none=True)
Expand Down Expand Up @@ -256,7 +257,7 @@ def enter_eventloop(self):
# which may be skipped by entering the eventloop
stream.flush(zmq.POLLOUT)
# restore default_int_handler
signal(SIGINT, default_int_handler)
self.pre_handler_hook()
while self.eventloop is not None:
try:
self.eventloop(self)
Expand All @@ -268,6 +269,7 @@ def enter_eventloop(self):
# eventloop exited cleanly, this means we should stop (right?)
self.eventloop = None
break
self.post_handler_hook()
self.log.info("exiting eventloop")

def start(self):
Expand Down