Fix failing test when user site-packages has no version number
Fix failing test when user site-packages has no version number

This error was first reported in
https://github.com/pypa/setuptools/commit/bfa75fc56d0bd47bd6c0edf9a0e579508c9fae9e#commitcomment-63663642

The approach taken here is to check for the '3.10' substring only if '3.1' is present.

pypa/setuptools,pypa/setuptools,pypa/setuptools