From e8ba3b86bfe9b00db71c97a0b19153f646b2ae89 Mon Sep 17 00:00:00 2001 From: Thijs Hekman Date: Wed, 10 Jan 2024 13:14:54 +0100 Subject: [PATCH] Bugfix on bugfix. KeyError instead of AttributeError --- python_src/lasp/lasp_measurement.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python_src/lasp/lasp_measurement.py b/python_src/lasp/lasp_measurement.py index 47b0093..381466d 100644 --- a/python_src/lasp/lasp_measurement.py +++ b/python_src/lasp/lasp_measurement.py @@ -987,15 +987,15 @@ class Measurement: # See if the base part of the filename is referring to a file that is already open with h5.File(fn, 'r') as f: try: - uuid = f.attrs['UUID'] - except AttributeError: + theuuid = f.attrs['UUID'] + except KeyError: # No UUID stored in measurement. This is an old measurement that did not have UUID's # We create a new UUID here such that the file is opened from the filesystem # anyhow. - uuid = str(uuid.uuid1()) + theuuid = str(uuid.uuid1()) - if uuid in Measurement.uuid_s.keys(): - return Measurement.uuid_s[uuid] + if theuuid in Measurement.uuid_s.keys(): + return Measurement.uuid_s[theuuid] return Measurement(fn)