Skip to content

Commit

Permalink
startup: catch errors in build_modules_xml.py, grass.py (#2686)
Browse files Browse the repository at this point in the history
  • Loading branch information
neteler committed Feb 13, 2023
1 parent aa51d69 commit 20bba91
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions gui/wxpython/tools/build_modules_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import grass.script.core as gcore
import grass.script.task as gtask
from grass.exceptions import ScriptError


def escapeXML(text):
Expand Down Expand Up @@ -80,11 +81,11 @@ def get_module_metadata(name):
"""
try:
task = gtask.parse_interface(name)
except:
except ScriptError as exc:
sys.stderr.write(
"Cannot parse interface for module %s. Empty strings"
" will be placed instead of description and keywords."
"\n" % name
" Reason: %s\n" % (name, str(exc))
)
return "", ""

Expand Down
3 changes: 2 additions & 1 deletion lib/init/grass.py
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,8 @@ def set_paths(grass_config_dir):

# Set LD_LIBRARY_PATH (etc) to find GRASS shared libraries
# this works for subprocesses but won't affect the current process
path_prepend(gpath("lib"), LD_LIBRARY_PATH_VAR)
if LD_LIBRARY_PATH_VAR:
path_prepend(gpath("lib"), LD_LIBRARY_PATH_VAR)


def find_exe(pgm):
Expand Down

0 comments on commit 20bba91

Please sign in to comment.