Skip to content

Commit

Permalink
Work around jupyter/nbclient#85
Browse files Browse the repository at this point in the history
  • Loading branch information
khaeru committed Sep 15, 2020
1 parent cd4a337 commit a57e16e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ixmp/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,15 @@ def run_notebook(nb_path, tmp_path, env=None, kernel=None, allow_errors=False):
import nbformat
from nbclient import NotebookClient

# Workaround for https://github.com/jupyter/nbclient/issues/85
if (
sys.version_info[0] == 3
and sys.version_info[1] >= 8
and sys.platform.startswith("win")
):
import asyncio
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

# Read the notebook
with open(nb_path) as f:
nb = nbformat.read(f, as_version=4)
Expand Down

0 comments on commit a57e16e

Please sign in to comment.