We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 16992d8 commit 1d54a0bCopy full SHA for 1d54a0b
nipype/utils/tests/test_functions.py
@@ -26,12 +26,16 @@ def test_func_py2():
26
def is_string():
27
return isinstance('string', str)
28
29
- def print_statement():
30
- # test python 2 compatibility
+def print_statement():
+ # test python 2 compatibility
31
+ try:
32
exec('print ""')
33
+ return True
34
+ except SyntaxError:
35
+ return False
36
37
wrapped_func = create_function_from_source(getsource(is_string))
38
assert is_string() == wrapped_func()
39
40
wrapped_func2 = create_function_from_source(getsource(print_statement))
- wrapped_func2()
41
+ assert wrapped_func2()
0 commit comments