Skip to content

Commit

Permalink
fix errors in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
almarklein committed Nov 26, 2018
1 parent a3f5825 commit db10021
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion flexx/app/_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,9 @@ def start(self):
# Make use of the semi-standard defined by IPython to determine
# if the ioloop is "hijacked" (e.g. in Pyzo).
if not getattr(self._loop, '_in_event_loop', False):
poller = self._loop.create_task(keep_awake())
try:
self._loop.run_until_complete(keep_awake())
self._loop.run_forever()
except KeyboardInterrupt:
logger.info('Flexx event loop interrupted.')
except TypeError as err:
Expand All @@ -145,6 +146,7 @@ def start(self):
logger.info('Interrupted Flexx event loop.')
else:
raise
poller.cancel()

def stop(self):
""" Stop the event loop. This does not close the connection; the server
Expand Down

0 comments on commit db10021

Please sign in to comment.