Replace dict comprehension, as it was only added in Py2.7 and Py3