Skip to content

Commit 4a47510

Browse files
authored
Hide pip error if not present (#3494)
1 parent b2767d2 commit 4a47510

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ansiblelint/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,9 @@ def guess_install_method() -> str:
232232
logging.debug("Skipping %s as it is not installed.", package_name)
233233
use_pip = False
234234
# pylint: disable=broad-except
235-
except AttributeError as exc:
235+
except (AttributeError, ModuleNotFoundError) as exc:
236236
# On Fedora 36, we got a AttributeError exception from pip that we want to avoid
237+
# On NixOS, we got a ModuleNotFoundError exception from pip that we want to avoid
237238
logging.debug(exc)
238239
use_pip = False
239240

0 commit comments

Comments
 (0)