Skip to content

Commit 0b510ed

Browse files
committed
fix: address @satra's comment
1 parent 49ada18 commit 0b510ed

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

nipype/pipeline/plugins/tools.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@ def report_crash(node, traceback=None, hostname=None):
4141
During the creation of this crashfile triggered by the above exception,
4242
another exception occurred:\n\n{}.""".format(exc).splitlines(keepends=True)
4343
else:
44-
if isinstance(result.runtime, list):
45-
host = result.runtime[0].hostname
46-
else:
47-
host = result.runtime.hostname
44+
if getattr(result, 'runtime', None):
45+
if isinstance(result.runtime, list):
46+
host = result.runtime[0].hostname
47+
else:
48+
host = result.runtime.hostname
4849

4950
# Try everything to fill in the host
5051
host = host or hostname or gethostname()
@@ -61,7 +62,7 @@ def report_crash(node, traceback=None, hostname=None):
6162
makedirs(crashdir, exist_ok=True)
6263
crashfile = os.path.join(crashdir, crashfile)
6364

64-
if node.config['execution']['crashfile_format'].lower() in ['text', 'txt']:
65+
if node.config['execution']['crashfile_format'].lower() in ('text', 'txt', '.txt'):
6566
crashfile += '.txt'
6667
else:
6768
crashfile += '.pklz'

0 commit comments

Comments
 (0)