Alternative code for older Python versions

Provide alternative code for Python < 2.7, which doesn't handle dictionary construction