Credit Markus and decitre for python 3 patches