Show More
@@ -152,9 +152,14 b' def get_root_modules():' | |||||
152 | return rootmodules |
|
152 | return rootmodules | |
153 |
|
153 | |||
154 |
|
154 | |||
155 | def is_importable(module, attr, only_modules): |
|
155 | def is_importable(module, attr: str, only_modules) -> bool: | |
156 | if only_modules: |
|
156 | if only_modules: | |
157 | return inspect.ismodule(getattr(module, attr)) |
|
157 | try: | |
|
158 | mod = getattr(module, attr) | |||
|
159 | except ModuleNotFoundError: | |||
|
160 | # See gh-14434 | |||
|
161 | return False | |||
|
162 | return inspect.ismodule(mod) | |||
158 | else: |
|
163 | else: | |
159 | return not(attr[:2] == '__' and attr[-2:] == '__') |
|
164 | return not(attr[:2] == '__' and attr[-2:] == '__') | |
160 |
|
165 |
General Comments 0
You need to be logged in to leave comments.
Login now