Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle ValueError #20

Merged
merged 2 commits into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion nodebook/ipython/nodebookext.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion nodebook/pickledict.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down