Skip to content

Commit 3a70e7a

Browse files
committed
fix: environment inputs not changed by config display variable
1 parent ab0743c commit 3a70e7a

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

nipype/interfaces/base.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,11 +1033,6 @@ def __init__(self, command=None, **inputs):
10331033
raise Exception("Missing command")
10341034
if command:
10351035
self._cmd = command
1036-
try:
1037-
display_var = config.get('execution', 'display_variable')
1038-
self.inputs.environ['DISPLAY'] = display_var
1039-
except NoOptionError:
1040-
pass
10411036

10421037
@property
10431038
def cmd(self):
@@ -1087,7 +1082,14 @@ def _run_interface(self, runtime):
10871082
setattr(runtime, 'stdout', None)
10881083
setattr(runtime, 'stderr', None)
10891084
setattr(runtime, 'cmdline', self.cmdline)
1090-
runtime.environ.update(self.inputs.environ)
1085+
environ = self.inputs.environ
1086+
if isdefined(environ):
1087+
try:
1088+
display_var = config.get('execution', 'display_variable')
1089+
environ.update({'DISPLAY': display_var})
1090+
except NoOptionError:
1091+
pass
1092+
runtime.environ.update(environ)
10911093
if not self._exists_in_path(self.cmd.split()[0]):
10921094
raise IOError("%s could not be found on host %s" % (self.cmd.split()[0],
10931095
runtime.hostname))

0 commit comments

Comments
 (0)