Fixes a Python 3.x regression introduced in a19e9d80