refactor "_sanitize" for Python < 2.7

I have a python2.6 project which I'd like to use this on, so it does not handle dictionary comprehensions. I believe this patch would make it compatible for Python 2.6+.