*** Wartungsfenster jeden ersten Mittwoch vormittag im Monat ***

Skip to content
Snippets Groups Projects
Commit 708bb7e1 authored by David Meyer's avatar David Meyer
Browse files

Fix context manager to `yield` if accidentally used twice.

parent 89fa3f90
No related branches found
No related tags found
1 merge request!1Merge from GitHub repo
......@@ -344,7 +344,8 @@ class Run(object):
if (self.__h5_file.mode == 'r') and (mode != 'r'):
msg = 'Cannot open file with a write mode; this run is read-only'
raise PermissionError(msg)
return None
yield None
return
with h5py.File(self.h5_path, mode) as f:
self.__h5_file = f
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment