diff --git a/CHANGELOG.md b/CHANGELOG.md index 86aedc4e..1ddc6774 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ **v5.3.0 (unreleased):** * Updated Otter Assign to throw a `ValueError` when invalid Python code is encountered in test cells per [#756](https://github.com/ucbds-infra/otter-grader/issues/756) +* Fixed an error causing intercell seeding code to be added to cells using cell magic commands which caused syntax errors per [#754](https://github.com/ucbds-infra/otter-grader/issues/754) **v5.2.2:** diff --git a/otter/execute/preprocessor.py b/otter/execute/preprocessor.py index 25edf262..9a482058 100644 --- a/otter/execute/preprocessor.py +++ b/otter/execute/preprocessor.py @@ -122,7 +122,7 @@ def add_seeds(self, nb): cells = nb.cells[1:] if skip_first else nb.cells for cell in cells: - if cell.cell_type == "code": + if cell.cell_type == "code" and not cell.source.startswith("%%"): cell.source = f"{do_seed}\n{cell.source}" def add_checks(self, nb):