explicitly set vstring to None in case of exceptions

This commit is contained in:
Axel Kohlmeyer
2021-05-09 05:58:20 -04:00
parent 10d7a9f553
commit c1891dca82

View File

@ -28,12 +28,15 @@ def get_version_number():
from importlib.metadata import version
try:
vstring = version('lammps')
except: pass
except:
vstring = None
else:
from pkg_resources import get_distribution
try:
vstring = get_distribution('lammps').version
except: pass
except:
vstring = None
if not vstring:
return 0