From 507ad8878cde1c5245750969e59951ee05844bf0 Mon Sep 17 00:00:00 2001 From: norohind <60548839+norohind@users.noreply.github.com> Date: Sun, 13 Nov 2022 14:27:05 +0300 Subject: [PATCH] main.py don't except KeyboardException on AudioController blocking --- main.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/main.py b/main.py index 8ebeccd..64f1b90 100644 --- a/main.py +++ b/main.py @@ -39,12 +39,9 @@ callback = AudioController.SessionCreateCallback(audio_controller) mgr.RegisterSessionNotification(callback) mgr.GetSessionEnumerator() -try: - audio_controller.start_blocking() +audio_controller.start_blocking() -except KeyboardInterrupt: - pass +mgr.UnregisterSessionNotification(callback) +audio_controller.pre_shutdown() -finally: - mgr.UnregisterSessionNotification(callback) - audio_controller.pre_shutdown() +logger.trace(f'Shutdown completed')