Skip to content

Commit b336132

Browse files
Terfeffigies
andauthored
return None if R can't be found
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
1 parent 931a766 commit b336132

File tree

1 file changed

+3
-5
lines changed
  • nipype/interfaces

1 file changed

+3
-5
lines changed

nipype/interfaces/r.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@
1919
def get_r_command():
2020
if "NIPYPE_NO_R" in os.environ:
2121
return None
22-
try:
23-
r_cmd = os.environ["RCMD"]
24-
except:
25-
r_cmd = "R"
26-
return r_cmd
22+
r_cmd = os.getenv("RCMD", default="R")
23+
24+
return r_cmd if which(r_cmd) else None
2725

2826

2927
no_r = get_r_command() is None

0 commit comments

Comments
 (0)