Skip to content

Commit bb905b9

Browse files
committed
[skip ci] fix ordering as per @djarecka
1 parent 396aa1e commit bb905b9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

nipype/pipeline/engine/nodes.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -394,16 +394,17 @@ def run(self, updatehash=False):
394394
if not force_run and str2bool(self.config['execution']['stop_on_first_rerun']):
395395
raise Exception('Cannot rerun when "stop_on_first_rerun" is set to True')
396396

397-
# Hashfile while running, remove if exists already
398-
hashfile_unfinished = op.join(
399-
outdir, '_0x%s_unfinished.json' % hashvalue)
397+
# Remove hashfile if it exists at this point (re-running)
400398
if op.exists(hashfile):
401399
os.remove(hashfile)
402400

401+
# Hashfile while running
402+
hashfile_unfinished = op.join(
403+
outdir, '_0x%s_unfinished.json' % hashvalue)
404+
403405
# Delete directory contents if this is not a MapNode or can't resume
404406
rm_outdir = not isinstance(self, MapNode) and not (
405407
self._interface.can_resume and op.isfile(hashfile_unfinished))
406-
407408
if rm_outdir:
408409
emptydirs(outdir, noexist_ok=True)
409410
else:

0 commit comments

Comments
 (0)