Duplicating code because Python 3 is ass also means duplicating bugfixes ._.