bpo-40436: Fix code parsing gdb version (GH-19792)


test_gdb and test.pythoninfo now check gdb command exit code.
(cherry picked from commit ec9bea4a3766bd815148a27f61eb24e7dd459ac7)

Co-authored-by: Victor Stinner <vstinner@python.org>
3 files changed