Skip to content

Commit

Permalink
Add some protection around presenting provencance information.
Browse files Browse the repository at this point in the history
  • Loading branch information
hsorby committed Jul 22, 2023
1 parent 947af8c commit 4a8b070
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/mapclient/core/provenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,16 @@ def _determine_capabilities():
for loader, module_name, is_pkg in pkgutil.walk_packages(mapclientplugins.__path__):
if is_pkg:
package_name = PLUGINS_PACKAGE_NAME + '.' + module_name
module = import_module(package_name)
mapclientplugins_info[package_name] = {
"version": module.__version__ if hasattr(module, '__version__') else "X.Y.Z",
"location": module.__location__ if hasattr(module, '__location__') else "<plugin-location-not-set>",
}
try:
module = import_module(package_name)
mapclientplugins_info[package_name] = {
"version": module.__version__ if hasattr(module, '__version__') else "X.Y.Z",
"location": module.__location__ if hasattr(module, '__location__') else "<plugin-location-not-set>",
}
except ModuleNotFoundError:
pass
except ImportError:
pass

return {**output_info, **mapclientplugins_info}

Expand Down

0 comments on commit 4a8b070

Please sign in to comment.