Use numeric index to check python major version

Python 2.6 and earlier uses a tuple, so indexing by keyword is not supported there.

Fixes the bug reported by `konradb` on IRC.