Fix handling of version_attr for python3