Restore Python 2 compatibility