You're best off setting server_version_parts = server_version.split('.') here and using that in the following lines.