I am working on building Python 2.7.4 on CentOS 6.4. When running the make test step, the test_gdb step fails, and I would like to get some more info as to why.

Build commands I'm running:

./configure --prefix=/usr/local/python-2.7.4 --enable-ipv6 --enable-unicode=ucs4 --enable-shared
make test

Output of make test:

... test test_gdb failed -- multiple errors occurred; run in verbose mode for details ...

So basically, I'm trying to figure out how to run the test_gdb test separately and in verbose mode. Sounds like I should use regrtest.py, but I seem to get invalid syntax with the various options I've tried. Any ideas?

banjer@somehost:/usr/local/src/Python-2.7.4> python Lib/test/regrtest.py -v test_gdb
  File "Lib/test/regrtest.py", line 679
SyntaxError: invalid syntax
  • Usually you just need to install a bunch of devel packages. Also make sure gdb is actually installed. I think there is a "Development" group also.
    – Keith
    Commented Apr 24, 2013 at 21:50
  • 1
    @Keith I'll definitely need to fix gdb, and you're probably right that I'm missing some devel headers. My question is more on how to run a single make test to get more detail as to why its failing, not just for gdb. On a side note, I'm running into this MAXREPEAT bug when I skip the tests, install python with make install and run python. Thats why I'm going through and making sure all the tests come out successfully first.
    – Banjer
    Commented Apr 25, 2013 at 12:15
  • I'm afraid that's just how the stock unittest framework works.
    – Keith
    Commented Apr 25, 2013 at 19:52

1 Answer 1


The actual lines around 679 in Lib/test/regrtest.py are:


This defines a mutable set and is syntax back-ported from 3.1 to 2.7. This syntax is not available in 2.6 or earlier version of python.

That your test raises a syntax error is probably because your default python is pre-2.7. If you would have executed:

./python Lib/test/regrtest.py -v test_gdb
^-- this is the difference

in that directory, you would have been testing the python executable you just compiled and not the default one provided in your path. Using that executable you are unlikely to get this particular error (but maybe others that are really gdb related).

  • You nailed it. The default python in my PATH was 2.6. Using the newly compiled python instead with ./python, I was able to actually run the individual test. Cheers!
    – Banjer
    Commented Apr 26, 2013 at 0:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .