diff --git a/src/spikeinterface/preprocessing/motion.py b/src/spikeinterface/preprocessing/motion.py index c9bc2a2207..7ac08bb3cc 100644 --- a/src/spikeinterface/preprocessing/motion.py +++ b/src/spikeinterface/preprocessing/motion.py @@ -322,6 +322,7 @@ def correct_motion( if overwrite: if folder.is_dir(): import shutil + shutil.rmtree(folder) else: assert not folder.exists(), f"Folder {folder} already exists"