explicitly set vstring to None in case of exceptions
This commit is contained in:
@ -28,12 +28,15 @@ def get_version_number():
|
|||||||
from importlib.metadata import version
|
from importlib.metadata import version
|
||||||
try:
|
try:
|
||||||
vstring = version('lammps')
|
vstring = version('lammps')
|
||||||
except: pass
|
except:
|
||||||
|
vstring = None
|
||||||
|
|
||||||
else:
|
else:
|
||||||
from pkg_resources import get_distribution
|
from pkg_resources import get_distribution
|
||||||
try:
|
try:
|
||||||
vstring = get_distribution('lammps').version
|
vstring = get_distribution('lammps').version
|
||||||
except: pass
|
except:
|
||||||
|
vstring = None
|
||||||
|
|
||||||
if not vstring:
|
if not vstring:
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
Reference in New Issue
Block a user