From 35da39bb1c5c80c18ade40fed296cfb47b158123 Mon Sep 17 00:00:00 2001 From: Thinh Nguyen Date: Fri, 2 Sep 2022 15:14:03 -0500 Subject: [PATCH] `missing_ok` arg only available in python 3.8+ --- element_array_ephys/readers/kilosort_triggering.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/element_array_ephys/readers/kilosort_triggering.py b/element_array_ephys/readers/kilosort_triggering.py index 8c063825..a1797721 100644 --- a/element_array_ephys/readers/kilosort_triggering.py +++ b/element_array_ephys/readers/kilosort_triggering.py @@ -116,13 +116,15 @@ def generate_CatGT_input_json(self): / f'{session_str}_g{gate_str}_imec{probe_str}' / f'{session_str}_g{gate_str}_t{trig_str}.imec{probe_str}.ap.bin') continuous_file_symlink.parent.mkdir(parents=True, exist_ok=True) - continuous_file_symlink.unlink(missing_ok=True) + if continuous_file_symlink.exists(): + continuous_file_symlink.unlink() continuous_file_symlink.symlink_to(continuous_file) input_meta_fullpath_symlink = (input_meta_fullpath.parent / f'{session_str}_g{gate_str}' / f'{session_str}_g{gate_str}_imec{probe_str}' / f'{session_str}_g{gate_str}_t{trig_str}.imec{probe_str}.ap.meta') input_meta_fullpath_symlink.parent.mkdir(parents=True, exist_ok=True) - input_meta_fullpath_symlink.unlink(missing_ok=True) + if input_meta_fullpath_symlink.exists(): + input_meta_fullpath_symlink.unlink() input_meta_fullpath_symlink.symlink_to(input_meta_fullpath) createInputJson(self._catGT_input_json.as_posix(),