Skip to content

Commit

Permalink
Merge pull request #296 from minrk/tornado-5
Browse files Browse the repository at this point in the history
fix %gui asyncio with tornado 5
  • Loading branch information
takluyver authored Jan 16, 2018
2 parents 3b6d089 + f5d5ffc commit 479932d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
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

0 comments on commit 479932d

Please sign in to comment.