Skip to content

Commit 24f2cbc

Browse files
committed
enh: roll back to a more constant behavior with errors
1 parent c5093fb commit 24f2cbc

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

nipype/interfaces/base/core.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,13 @@
1919
from ... import config, logging, LooseVersion
2020
from ...utils.provenance import write_provenance
2121
from ...utils.misc import str2bool
22-
from ...utils.filemanip import split_filename, which, get_dependencies, canonicalize_env
22+
from ...utils.filemanip import (
23+
canonicalize_env,
24+
get_dependencies,
25+
indirectory,
26+
split_filename,
27+
which,
28+
)
2329
from ...utils.subprocess import run_command
2430

2531
from ...external.due import due
@@ -377,10 +383,12 @@ def run(self, cwd=None, ignore_exception=None, **inputs):
377383
else self.ignore_exception,
378384
)
379385

380-
with rtc(self, cwd=cwd, redirect_x=self._redirect_x) as runtime:
386+
with indirectory(cwd or os.getcwd()):
381387
self.inputs.trait_set(**inputs)
382-
self._check_mandatory_inputs()
383-
self._check_version_requirements(self.inputs)
388+
self._check_mandatory_inputs()
389+
self._check_version_requirements(self.inputs)
390+
391+
with rtc(self, cwd=cwd, redirect_x=self._redirect_x) as runtime:
384392

385393
# Grab inputs now, as they should not change during execution
386394
inputs = self.inputs.get_traitsfree()

0 commit comments

Comments
 (0)