Skip to content

Commit ea9d196

Browse files
committed
Fix lambda parameter amount to allow termination on sigint / sigkill
1 parent d4e33cf commit ea9d196

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

aw_qt/trayicon.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,10 @@ def run(manager: Manager, testing: bool = False) -> Any:
159159

160160
app = QApplication(sys.argv)
161161

162-
# FIXME: remove ignores after https://github.com/python/mypy/issues/2955 has been fixed
163-
# Without this, Ctrl+C will have no effect
164-
signal.signal(signal.SIGINT, lambda: exit(manager)) #type: ignore
165-
# Ensure cleanup happens on SIGTERM
166-
signal.signal(signal.SIGTERM, lambda: exit(manager)) #type: ignore
162+
# Ensure cleanup happens on SIGTERM and SIGINT (kill and ctrl+c etc)
163+
# The 2 un-used variables are necessary
164+
signal.signal(signal.SIGINT, lambda _, __: exit(manager))
165+
signal.signal(signal.SIGTERM, lambda _, __: exit(manager))
167166

168167
timer = QtCore.QTimer()
169168
timer.start(100) # You may change this if you wish.

0 commit comments

Comments
 (0)