diff options
Diffstat (limited to 'gdb/testsuite/lib/gdb.exp')
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 781ccc8..38a8ac6 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -1550,7 +1550,10 @@ proc skip_java_tests {} { proc skip_python_tests {} { global gdb_prompt - gdb_test_multiple "python print 'test'" "verify python support" { + global gdb_py_is_py3k + global gdb_py_is_py24 + + gdb_test_multiple "python print ('test')" "verify python support" { -re "not supported.*$gdb_prompt $" { unsupported "Python support is disabled." return 1 @@ -1558,6 +1561,26 @@ proc skip_python_tests {} { -re "$gdb_prompt $" {} } + set gdb_py_is_py24 0 + gdb_test_multiple "python print (sys.version_info\[0\])" "check if python 3" { + -re "3.*$gdb_prompt $" { + set gdb_py_is_py3k 1 + } + -re ".*$gdb_prompt $" { + set gdb_py_is_py3k 0 + } + } + if { $gdb_py_is_py3k == 0 } { + gdb_test_multiple "python print (sys.version_info\[1\])" "check if python 2.4" { + -re "\[45\].*$gdb_prompt $" { + set gdb_py_is_py24 1 + } + -re ".*$gdb_prompt $" { + set gdb_py_is_py24 0 + } + } + } + return 0 } |