Fix a problem running tests/compare.py in Python 3.