Skip to content

Commit 6aa81af

Browse files
Satify mypy and flake8 in CI (but not for pre-commit)
1 parent 18405b7 commit 6aa81af

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/main/python/main/ayab/engine/engine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def __populate_ports(self, port_list: Optional[list[str]] = None) -> None:
112112
combo_box.addItem(QCoreApplication.translate("KnitEngine", "Simulation"))
113113

114114
def __read_portname(self) -> str:
115-
return cast(str, self.ui.serial_port_dropdown.currentText())
115+
return self.ui.serial_port_dropdown.currentText()
116116

117117
def knit_config(self, image: Image.Image) -> None:
118118
"""

src/main/python/main/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@
2121
if TYPE_CHECKING: # TODO: why does mypy not resolve the absolute import correctly?
2222
from main.ayab.ayab import GuiMain
2323
from main.ayab import utils
24+
2425
# from https://github.com/python/typing/discussions/1102#discussioncomment-2376328
2526
cached_property = property
2627
else:
2728
try:
2829
from main.ayab.ayab import GuiMain
2930
from main.ayab import utils
30-
except: #'fbs run' needs weird things.
31+
except ModuleNotFoundError: # 'fbs run' needs weird things.
3132
from ayab.ayab import GuiMain
3233
from ayab import utils
3334
from fbs_runtime.application_context.PySide6 import cached_property

0 commit comments

Comments
 (0)