Skip to content
Snippets Groups Projects
Verified Commit c1a789e1 authored by Xavier Robin's avatar Xavier Robin
Browse files

feat: SCHWED-5913 make invalid $OST_COMPOUNDS_CHEMLIB an error

parent df8c9696
No related branches found
No related tags found
No related merge requests found
......@@ -87,15 +87,14 @@ def _SetupCompoundsLib():
"""
# Try with the $OST_COMPOUNDS_CHEMLIB environment variable
compound_lib_path = os.getenv("OST_COMPOUNDS_CHEMLIB")
try:
_TrySetCompoundsLib(compound_lib_path)
except ValueError:
if compound_lib_path:
LogWarning("Could not load $OST_COMPOUNDS_CHEMLIB as a compound library"
": '%s'. Falling back to default." % ( compound_lib_path))
pass
else:
return
if compound_lib_path:
compound_lib = conop.CompoundLib.Load(compound_lib_path)
if compound_lib is None:
raise RuntimeError("Could not load $OST_COMPOUNDS_CHEMLIB as a compound "
"library: '%s'." % compound_lib_path)
else:
conop.SetDefaultLib(compound_lib)
return
# Try from GetSharedDataPath() - requires $OST_ROOT to be set.
try:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment