Skip to content

Commit 7673562

Browse files
committed
Linting and typing fixes
1 parent 661bab7 commit 7673562

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/AutoSplit.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import sys
99
from time import time
1010
from types import FunctionType
11+
from typing import NoReturn
1112

1213
import certifi
1314
import cv2
@@ -694,6 +695,8 @@ def __similarity_threshold_loop(self, number_of_split_images: int, dummy_splits_
694695

695696
QTest.qWait(wait_delta_ms)
696697

698+
return False
699+
697700
def __pause_loop(self, stop_time: float, message: str):
698701
"""
699702
Wait for a certain time and show the timer to the user.
@@ -870,7 +873,7 @@ def closeEvent(self, a0: QtGui.QCloseEvent | None = None):
870873
Exit safely when closing the window
871874
"""
872875

873-
def exit_program():
876+
def exit_program() -> NoReturn:
874877
if self.update_auto_control:
875878
self.update_auto_control.terminate()
876879
self.capture_method.close(self)

src/error_messages.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import sys
77
import traceback
88
from types import TracebackType
9-
from typing import TYPE_CHECKING
9+
from typing import TYPE_CHECKING, NoReturn
1010

1111
from PyQt6 import QtCore, QtWidgets
1212

@@ -185,7 +185,7 @@ def excepthook(exception_type: type[BaseException], exception: BaseException, _t
185185
return excepthook
186186

187187

188-
def handle_top_level_exceptions(exception: Exception):
188+
def handle_top_level_exceptions(exception: Exception) -> NoReturn:
189189
message = f"AutoSplit encountered an unrecoverable exception and will likely now close. {CREATE_NEW_ISSUE_MESSAGE}"
190190
# Print error to console if not running in executable
191191
if FROZEN:

0 commit comments

Comments
 (0)