From 28a80176ba53c1dc55f7ad5120f0fbe5ceae18e5 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 19 Apr 2011 19:06:28 -0400 Subject: [PATCH] Better solution to overwriting preexisting datasets. Remove them and start from scratch. The previous implementation did things like >>> dataset = 'no' >>> dataset[...] = 'yes' >>> dataset[...] 'ye' --- pypiezo/config.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pypiezo/config.py b/pypiezo/config.py index 878027b..1d67a18 100644 --- a/pypiezo/config.py +++ b/pypiezo/config.py @@ -576,12 +576,12 @@ class _HDF5Config (_BackedConfig): else: f = None for s in self.settings: + value = s.convert_to_text(self[s.name]) try: - dataset = group[s.name] + del group[s.name] except KeyError: - group[s.name] = s.convert_to_text(self[s.name]) - else: - group[s.name][...] = s.convert_to_text(self[s.name]) + pass + group[s.name] = value if f: f.close() -- 2.26.2