From a9b31bb4dede03caa98cbf22293cdb6ae1e80d41 Mon Sep 17 00:00:00 2001 From: "Adam J. Jackson" Date: Wed, 6 Sep 2023 16:28:21 +0100 Subject: [PATCH] Cleaner break logic Co-authored-by: Jacob Wilkins <46597752+oerc0122@users.noreply.github.com> --- euphonic/readers/castep.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/euphonic/readers/castep.py b/euphonic/readers/castep.py index f60d25b9f..65455a0d9 100644 --- a/euphonic/readers/castep.py +++ b/euphonic/readers/castep.py @@ -405,10 +405,9 @@ def _read_frequency_blocks(*args, **kwargs) -> Iterator[_FrequencyBlock]: """Iterate over frequency blocks""" while True: frequency_block = _read_frequency_block(*args, **kwargs) - if frequency_block: - yield frequency_block - else: + if frequency_block is None: break + yield frequency_block def read_interpolation_data(