From: Christian Heller Date: Thu, 3 Apr 2025 02:28:30 +0000 (+0200) Subject: Fix wrongly placed assert. X-Git-Url: https://plomlompom.com/repos/%22https:/validator.w3.org/static/%7B%7Bdb.prefix%7D%7D/day_todos?a=commitdiff_plain;p=ledgplom Fix wrongly placed assert. --- diff --git a/src/ledgplom/ledger.py b/src/ledgplom/ledger.py index dda0dec..552987b 100644 --- a/src/ledgplom/ledger.py +++ b/src/ledgplom/ledger.py @@ -489,7 +489,6 @@ class _Booking(_LinesBlock): def move(self, up: bool) -> None: """Move self and following gap up or down in line blocks chain.""" old_next = self.next - assert old_next is not None assert self.next_block is not None if up: old_prev = self.prev @@ -500,6 +499,7 @@ class _Booking(_LinesBlock): self.next_block.next_block = old_prev old_prev.next_block.next_block = old_next else: + assert old_next is not None old_prev_block = self.prev_block self.next_block.next_block = old_next.next self.prev_block = old_next.next_block