diff --git a/knowit/units.py b/knowit/units.py index 51e6cae..c8421ca 100644 --- a/knowit/units.py +++ b/knowit/units.py @@ -1,5 +1,8 @@ +import logging import typing +logger = logging.getLogger(__name__) + class NullRegistry: """A NullRegistry that masquerades as a pint.UnitRegistry.""" @@ -30,6 +33,8 @@ def _build_unit_registry(): return registry except ModuleNotFoundError: pass + except Exception: + logger.exception("Cannot import the pint package") return NullRegistry()