Skip to content

fix: ensure ipython engine is not left in an undefined directory - close... #987

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 3, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion nipype/pipeline/plugins/ipython.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ def execute_task(pckld_task, node_config, updatehash):
from nipype import config, logging
traceback=None
result=None
import os
cwd = os.getcwd()
try:
config.update_config(node_config)
logging.update_logging(config)
Expand All @@ -31,6 +33,7 @@ def execute_task(pckld_task, node_config, updatehash):
except:
traceback = format_exc()
result = task.result
os.chdir(cwd)
return result, traceback, gethostname()

class IPythonPlugin(DistributedPluginBase):
Expand Down Expand Up @@ -72,7 +75,7 @@ def run(self, graph, config, updatehash=False):

def _get_result(self, taskid):
if taskid not in self.taskmap:
raise ValueError('Task %d not in pending list'%taskid)
raise ValueError('Task %d not in pending list' % taskid)
if self.taskmap[taskid].ready():
result, traceback, hostname = self.taskmap[taskid].get()
result_out = dict(result=None, traceback=None)
Expand Down