patches for python 3