[python2.6] Edit code for backward compatibility with Python2.6 where dictionary comprehensions do not exist