We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 30a9453 + d2abdc9 commit 1d6fea7Copy full SHA for 1d6fea7
nipype/caching/memory.py
@@ -76,7 +76,14 @@ def __call__(self, **kwargs):
76
job_name = hasher.hexdigest()
77
node = Node(interface, name=job_name)
78
node.base_dir = os.path.join(self.base_dir, dir_name)
79
- out = node.run()
+
80
+ cwd = os.getcwd()
81
+ try:
82
+ out = node.run()
83
+ finally:
84
+ # node.run() changes to the node directory - if something goes wrong
85
+ # before it cds back you would end up in strange places
86
+ os.chdir(cwd)
87
if self.callback is not None:
88
self.callback(dir_name, job_name)
89
return out
0 commit comments