fall back to python 2.6 features; remove obsolete code