aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/ipython/py3/IPython/core/completerlib.py
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2024-06-15 14:18:22 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2024-06-15 14:27:16 +0300
commitb52a8ab5cd66952839ada0843539b5564108a052 (patch)
tree659c3387aee1dbb2629b3afd68f8d306d37b45c2 /contrib/python/ipython/py3/IPython/core/completerlib.py
parent7d673060f61f85b3e440fa45df26795d3653c8d2 (diff)
downloadydb-b52a8ab5cd66952839ada0843539b5564108a052.tar.gz
Intermediate changes
Diffstat (limited to 'contrib/python/ipython/py3/IPython/core/completerlib.py')
-rw-r--r--contrib/python/ipython/py3/IPython/core/completerlib.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/contrib/python/ipython/py3/IPython/core/completerlib.py b/contrib/python/ipython/py3/IPython/core/completerlib.py
index de6c4249b0..05f39e5015 100644
--- a/contrib/python/ipython/py3/IPython/core/completerlib.py
+++ b/contrib/python/ipython/py3/IPython/core/completerlib.py
@@ -199,9 +199,14 @@ def get_root_modules():
return rootmodules
-def is_importable(module, attr, only_modules):
+def is_importable(module, attr: str, only_modules) -> bool:
if only_modules:
- return inspect.ismodule(getattr(module, attr))
+ try:
+ mod = getattr(module, attr)
+ except ModuleNotFoundError:
+ # See gh-14434
+ return False
+ return inspect.ismodule(mod)
else:
return not(attr[:2] == '__' and attr[-2:] == '__')