Fix test on Python 3.  Fixes #2080