Bugfix on bugfix. KeyError instead of AttributeError
This commit is contained in:
parent
14ab3d9dfe
commit
e8ba3b86bf
@ -987,15 +987,15 @@ class Measurement:
|
|||||||
# See if the base part of the filename is referring to a file that is already open
|
# See if the base part of the filename is referring to a file that is already open
|
||||||
with h5.File(fn, 'r') as f:
|
with h5.File(fn, 'r') as f:
|
||||||
try:
|
try:
|
||||||
uuid = f.attrs['UUID']
|
theuuid = f.attrs['UUID']
|
||||||
except AttributeError:
|
except KeyError:
|
||||||
# No UUID stored in measurement. This is an old measurement that did not have UUID's
|
# 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
|
# We create a new UUID here such that the file is opened from the filesystem
|
||||||
# anyhow.
|
# anyhow.
|
||||||
uuid = str(uuid.uuid1())
|
theuuid = str(uuid.uuid1())
|
||||||
|
|
||||||
if uuid in Measurement.uuid_s.keys():
|
if theuuid in Measurement.uuid_s.keys():
|
||||||
return Measurement.uuid_s[uuid]
|
return Measurement.uuid_s[theuuid]
|
||||||
|
|
||||||
return Measurement(fn)
|
return Measurement(fn)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user