From 939e713e09b80981e164160680f37e35f45d5f30 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Sat, 5 Nov 2016 23:14:21 +0100 Subject: [PATCH] tests: update to work with Jupyter 4.2 Jupyter 4.2 just landed in Debian unstable, so we have a few failures because of all the renamings. * tests/python/ipnbdoctest.py: Adjust imports for Jupyter 4.2. --- tests/python/ipnbdoctest.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/python/ipnbdoctest.py b/tests/python/ipnbdoctest.py index 9331482c7..6e1f00800 100755 --- a/tests/python/ipnbdoctest.py +++ b/tests/python/ipnbdoctest.py @@ -30,13 +30,19 @@ except: sys.exit(77) try: - from IPython.kernel import KernelManager + from jupyter_client import KernelManager except ImportError: - from IPython.zmq.blockingkernelmanager \ - import BlockingKernelManager as KernelManager + try: + from IPython.kernel import KernelManager + except ImportError: + from IPython.zmq.blockingkernelmanager \ + import BlockingKernelManager as KernelManager -# Until Debian ships IPython 3.0, we stick to the v3 format. -from IPython.nbformat import v3 as nbformat +# Until Debian Stable ships IPython >3.0, we stick to the v3 format. +try: + from nbformat import v3 as nbformat +except ImportError: + from IPython.nbformat import v3 as nbformat def compare_png(a64, b64): """compare two b64 PNGs (incomplete)"""