From 85eb7249ad1439be091a1d97cbe1b071b24acef1 Mon Sep 17 00:00:00 2001 From: Chris Kerr Date: Sun, 10 Mar 2019 10:34:02 +0100 Subject: [PATCH] Use break instead of StopIteration - fixes #17 --- galvani/BioLogic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/galvani/BioLogic.py b/galvani/BioLogic.py index e5bdb17..07172b5 100644 --- a/galvani/BioLogic.py +++ b/galvani/BioLogic.py @@ -234,7 +234,7 @@ def read_VMP_modules(fileobj, read_module_data=True): while True: module_magic = fileobj.read(len(b'MODULE')) if len(module_magic) == 0: # end of file - raise StopIteration + break elif module_magic != b'MODULE': raise ValueError("Found %r, expecting start of new VMP MODULE" % module_magic)