From 1746399cbbf86b064fb9f6aed5fe28afc8066028 Mon Sep 17 00:00:00 2001 From: philipstarkey Date: Wed, 24 Jun 2020 18:29:12 +1000 Subject: [PATCH] Fix h5py deprecation warning Addresses labscript-suite/labscript-utils#47 for the labscript module --- labscript/labscript.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/labscript/labscript.py b/labscript/labscript.py index bd48e8a..b3e9223 100644 --- a/labscript/labscript.py +++ b/labscript/labscript.py @@ -2279,7 +2279,7 @@ def generate_code(): elif not os.path.exists(compiler.hdf5_filename): with h5py.File(compiler.hdf5_filename ,'w') as hdf5_file: hdf5_file.create_group('globals') - with h5py.File(compiler.hdf5_filename) as hdf5_file: + with h5py.File(compiler.hdf5_filename, 'a') as hdf5_file: try: hdf5_file.create_group('devices') hdf5_file.create_group('calibrations')