diff --git a/nodebook/ipython/nodebookext.py b/nodebook/ipython/nodebookext.py index 9e1c06b..8504092 100644 --- a/nodebook/ipython/nodebookext.py +++ b/nodebook/ipython/nodebookext.py @@ -67,7 +67,11 @@ def execute_cell(line, cell): ipython magic for executing nodebook cell, expects cell id and parent id inline, followed by code """ assert NODEBOOK_STATE['nodebook'] is not None, "Nodebook not initialized, please use %nodebook {nodebook_name}" - cell_id, parent_id = line.lstrip().split(' ') + try: + cell_id, parent_id = line.lstrip().split(' ') + except ValueError: + cell_id = line.lstrip() + parent_id = None # make sure cell exists and is in the right position NODEBOOK_STATE['nodebook'].insert_node_after(cell_id, parent_id) diff --git a/nodebook/pickledict.py b/nodebook/pickledict.py index 33a32e3..3dc16bc 100644 --- a/nodebook/pickledict.py +++ b/nodebook/pickledict.py @@ -26,7 +26,7 @@ from UserDict import DictMixin except ImportError: # see https://github.com/flask-restful/flask-restful/pull/231/files - from collections import MutableMapping as DictMixin + from collections.abc import MutableMapping as DictMixin PANDAS_CODE = 1 CLOUDPICKLE_CODE = 2