Make the python test scripts work on python3

The python scripts invoked by 'make check' didn't work on python3
before.  That was a problem on systems where 'python' is python3.

Fixes bug 11608; bugfix on 0.2.5.2-alpha.
Merge remote-tracking branch 'public/bug11608'