Skip to content

Commit 442b777

Browse files
fixing the context
1 parent cdd7920 commit 442b777

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

mne_bids/_fileio.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,12 @@ def _open_lock(path, *args, lock_timeout=None, **kwargs):
155155
canonical_path,
156156
timeout=lock_timeout,
157157
) as lock_context:
158-
try:
159-
with lock_context:
160-
if args or kwargs:
161-
with open(canonical_path, *args, **kwargs) as fid:
162-
yield fid
163-
else:
164-
yield None
165-
finally:
166-
cleanup_lock_files(canonical_path)
158+
with lock_context:
159+
if args or kwargs:
160+
with open(canonical_path, *args, **kwargs) as fid:
161+
yield fid
162+
else:
163+
yield None
167164
finally:
168165
with _ACTIVE_LOCKS_GUARD:
169166
_ACTIVE_LOCKS[lock_key] -= 1

0 commit comments

Comments
 (0)