Support reading version_info for Python <2.7

Named component attributes were only introduced in 2.7, so the test
fails with an attribute error for earlier versions.