Skip to content

Commit b289423

Browse files
committed
Supressing a log warning when the package is frozen
1 parent c6f162f commit b289423

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

cq_editor/widgets/editor.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,9 +551,13 @@ def get_imported_module_paths(self, module_path):
551551
except Exception as err:
552552
# The module finder has trouble when CadQuery is imported in the top level script and in
553553
# imported modules. The warning about it can be ignored.
554-
if "cadquery" not in finder.badmodules or (
555-
"cadquery" in finder.badmodules and len(finder.badmodules) > 1
554+
if (
555+
(isinstance(err, AttributeError) and "is_package" in str(err))
556+
or ("cadquery" not in finder.badmodules)
557+
or ("cadquery" in finder.badmodules and len(finder.badmodules) > 1)
556558
):
559+
pass
560+
else:
557561
self._logger.warning(
558562
f"Cannot determine imported modules in {module_path}: {type(err).__name__} {err}"
559563
)

0 commit comments

Comments
 (0)