From f41be396faa5b9d0d35db27da0cf76dc52a892fa Mon Sep 17 00:00:00 2001 From: Javi Merino Date: Thu, 16 Apr 2015 18:21:40 +0100 Subject: [PATCH] Use notebook format 3 for ipynb_exporter The file assumes format 3 throughout the code, so explicitly import that format instead of the generic "current" format. --- wlauto/utils/ipython.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wlauto/utils/ipython.py b/wlauto/utils/ipython.py index b903e472..01fb9c81 100644 --- a/wlauto/utils/ipython.py +++ b/wlauto/utils/ipython.py @@ -30,15 +30,15 @@ except ImportError as import_error: if IPython and (IPython.version_info[0] == 2): import IPython.kernel - import IPython.nbformat.current + import IPython.nbformat.v3 def read_notebook(notebook_in): - return IPython.nbformat.current.reads_json(notebook_in) + return IPython.nbformat.v3.reads_json(notebook_in) def write_notebook(notebook, fout): - IPython.nbformat.current.write(notebook, fout, 'json') + IPython.nbformat.v3.nbjson.JSONWriter().write(notebook, fout) - NotebookNode = IPython.nbformat.current.NotebookNode + NotebookNode = IPython.nbformat.v3.NotebookNode elif IPython: # Unsupported IPython version