Downgrade Python in test script to 2.4

Remove post-2.4 syntax from the "generate.py" script so that it
will run on vintage Linux with old Python installed.

Tests now pass on CentOS 5.9.