use unknown to specify unknown versions

This commit is contained in:
Ronny Pfannschmidt 2017-04-20 21:46:58 +02:00
parent 2cf422733c
commit 4242bf6262
1 changed files with 5 additions and 2 deletions

View File

@ -1,7 +1,10 @@
__all__ = ['__version__']
import pkg_resources
__all__ = ['__version__']
try:
__version__ = pkg_resources.get_distribution('pytest').version
except Exception:
__version__ = None # broken installation, we don't even try
# broken installation, we don't even try
# unknown only works because we do poor mans version compare
__version__ = 'unknown'