F
This commit is contained in:
@@ -75,12 +75,31 @@ def import_cmd_module(mod_name: str):
|
||||
return None
|
||||
for package in ("cmdnat", "cmdlet", None):
|
||||
try:
|
||||
# When attempting a bare import (package is None), prefer the repo-local
|
||||
# `MPV` package for the `mpv` module name so we don't accidentally
|
||||
# import the third-party `mpv` package (python-mpv) which can raise
|
||||
# OSError if system libmpv is missing.
|
||||
if package is None and normalized == "mpv":
|
||||
try:
|
||||
return import_module("MPV")
|
||||
except ModuleNotFoundError:
|
||||
# Local MPV package not present; fall back to the normal bare import.
|
||||
pass
|
||||
|
||||
qualified = f"{package}.{normalized}" if package else normalized
|
||||
return import_module(qualified)
|
||||
except ModuleNotFoundError:
|
||||
# Module not available in this package prefix; try the next.
|
||||
continue
|
||||
except Exception as exc:
|
||||
logger.exception("Unexpected error importing module %s: %s", qualified, exc)
|
||||
except (ImportError, OSError) as exc:
|
||||
# Some native/binary-backed packages (e.g., mpv) raise ImportError/OSError
|
||||
# on systems missing shared libraries. These are optional; log a short
|
||||
# warning but avoid spamming the console with a full traceback.
|
||||
logger.warning("Optional module %s failed to import: %s", qualified, exc)
|
||||
continue
|
||||
except Exception:
|
||||
# Unexpected errors should be loud and include a traceback to aid debugging.
|
||||
logger.exception("Unexpected error importing module %s", qualified)
|
||||
continue
|
||||
return None
|
||||
|
||||
|
||||
@@ -1353,7 +1353,8 @@ class PipelineExecutor:
|
||||
def _add(value) -> None:
|
||||
try:
|
||||
text = str(value or "").strip().lower()
|
||||
except Exception:
|
||||
except Exception as exc:
|
||||
logger.debug("Failed to normalize candidate value: %s", exc, exc_info=True)
|
||||
return
|
||||
if not text or text in seen:
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user