Skip to content

Commit d7c9e97

Browse files
committed
Making the escape for the warning even more narrow
1 parent 9ce340f commit d7c9e97

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

cq_editor/widgets/editor.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,11 @@ def get_imported_module_paths(self, module_path):
550550
self._logger.warning(f"Syntax error in {module_path}: {err}")
551551
except Exception as err:
552552
# Suppress PyInstaller-specific module finder error
553-
if isinstance(err, AttributeError) and "is_package" in str(err):
553+
if (
554+
getattr(sys, "frozen", False)
555+
and isinstance(err, AttributeError)
556+
and "is_package" in str(err)
557+
):
554558
pass
555559
# The module finder has trouble when CadQuery is imported in the top level script and in
556560
# imported modules. The warning about it can be ignored.

0 commit comments

Comments
 (0)