Python 3 compatibility. PYTHON-494