Improve version test (use pkg_resources to compare versions). Also log failures to stderr.
--HG-- branch : pytest-2.7
This commit is contained in:
parent
b7d43c5a5d
commit
40a682476d
6
setup.py
6
setup.py
|
@ -29,8 +29,10 @@ def get_version():
|
|||
def has_newish_setuptools():
|
||||
try:
|
||||
import setuptools
|
||||
return tuple(int(i) for i in str(setuptools.__version__).split('.')) > (0, 7)
|
||||
except Exception:
|
||||
import pkg_resources
|
||||
return pkg_resources.parse_version(setuptools.__version__) >= pkg_resources.parse_version('0.7')
|
||||
except Exception as exc:
|
||||
sys.stderr.write("Could not test setuptool's version: %s\n" % exc)
|
||||
return False
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue