Skip to content

Commit 1d54a0b

Browse files
committed
fix: assert print_statement test
1 parent 16992d8 commit 1d54a0b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

nipype/utils/tests/test_functions.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,16 @@ def test_func_py2():
2626
def is_string():
2727
return isinstance('string', str)
2828

29-
def print_statement():
30-
# test python 2 compatibility
29+
def print_statement():
30+
# test python 2 compatibility
31+
try:
3132
exec('print ""')
33+
return True
34+
except SyntaxError:
35+
return False
3236

3337
wrapped_func = create_function_from_source(getsource(is_string))
3438
assert is_string() == wrapped_func()
3539

3640
wrapped_func2 = create_function_from_source(getsource(print_statement))
37-
wrapped_func2()
41+
assert wrapped_func2()

0 commit comments

Comments
 (0)