Try feature detection instead of version check
PEP8 fixes