Skip to content

Commit

Permalink
Pop instead of del so we are resiliant to multiple validation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Wold committed Jan 21, 2022
1 parent d2c103f commit 5f97c02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nbformat/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def iter_validate(nbdict=None, ref=None, version=None, version_minor=None,
error_tree = validator.error_tree(errors)
if "metadata" in error_tree:
for key in error_tree["metadata"]:
del nbdict["metadata"][key]
nbdict["metadata"].pop(key, None)

if "cells" in error_tree:
number_of_cells = len(nbdict.get("cells", 0))
Expand Down

0 comments on commit 5f97c02

Please sign in to comment.