Sanitize the Python 2 check

This broke for me on a project that has a module named `builtins`. Let's just do a proper check using the normal `sys.version_info` API.