2 ms·
I think there are other ways to do it, like https://docs.python.org/3/library/importlib.html#checking-if-a-module-can-be-imported https://docs.python.org/3/libr
by cozzyd 5y ago
I think there are other ways to do it, like https://docs.python.org/3/library/importlib.html#checking-if-a-module-can-be-imported https://docs.python.org/3/library/importlib.html#checking-if... (though this only works in Python 3.4+ it seems, which might be a constraint and of course many codebases will predate this idiom)