Skip to content

Commit

Permalink
Ignore .nfs placeholder files when catching the error
Browse files Browse the repository at this point in the history
- I forgot that `os.listdir` also lists hidden files in the previous
  commit
  • Loading branch information
HippocampusGirl committed Jul 29, 2021
1 parent 67e1d56 commit 52d6e34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nipype/utils/filemanip.py
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ def emptydirs(path, noexist_ok=False):
try:
shutil.rmtree(path)
except OSError as ex:
elcont = os.listdir(path)
elcont = [p for p in os.listdir(path) if not p.startswith(".nfs")]
if ex.errno in [errno.ENOTEMPTY, errno.EBUSY] and not elcont:
fmlogger.warning(
"An exception was raised trying to remove old %s, but the path"
Expand Down

0 comments on commit 52d6e34

Please sign in to comment.