Skip to content

Commit 39742cf

Browse files
committed
make fakes3 detection more reliable and python <2.6 compatible
1 parent 608f3f7 commit 39742cf

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

nipype/interfaces/tests/test_io.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# vi: set ft=python sts=4 ts=4 sw=4 et:
44
from __future__ import print_function, unicode_literals
55
from builtins import str, zip, range, open
6-
6+
from future import standard_library
77
import os
88
import glob
99
import shutil
@@ -34,13 +34,11 @@
3434
noboto3 = True
3535

3636
# Check for fakes3
37-
import subprocess
37+
standard_library.install_aliases()
38+
from subprocess import check_call
3839
try:
39-
ret_code = subprocess.check_call(['which', 'fakes3'], stdout=open(os.devnull, 'wb'))
40-
if ret_code == 0:
41-
fakes3 = True
42-
else:
43-
fakes3 = False
40+
ret_code = check_call(['which', 'fakes3'], stdout=open(os.devnull, 'wb'))
41+
fakes3 = (ret_code == 0)
4442
except subprocess.CalledProcessError:
4543
fakes3 = False
4644

0 commit comments

Comments
 (0)