From 3973f0c3c54b60eb857694c9ac5198db929a31dd Mon Sep 17 00:00:00 2001 From: Chuck <33324927+ChuckBuilds@users.noreply.github.com> Date: Wed, 30 Sep 2026 20:26:12 -0400 Subject: [PATCH] refactor(scroll): no assert in _extended_strip An assert vanishes under python -O (Codacy); a real check says the same. Co-Authored-By: Claude Opus 5.5 --- src/common/scroll_helper.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/scroll_helper.py b/src/common/scroll_helper.py index db2d248f..4b8cea9b 100644 --- a/src/common/scroll_helper.py +++ b/src/common/scroll_helper.py @@ -752,7 +752,9 @@ class ScrollHelper: def _extended_strip(self, addition: np.ndarray) -> np.ndarray: """The strip with ``addition`` after it, written in place when it fits.""" live = self.cached_array - assert live is not None + if live is None: + # append_content builds a first strip itself and never comes here. + raise RuntimeError("no strip to extend") width = live.shape[1] added = addition.shape[1] buffer = self._strip_buffer