system_hotkey icon indicating copy to clipboard operation
system_hotkey copied to clipboard

InvalidKeyError is cannot be caught via try-except block

Open jezztify opened this issue 3 years ago • 0 comments

import sys
from system_hotkey import SystemHotkey, InvalidKeyError
try:
        hk = SystemHotkey()
        hk.register(["alt","q'"], callback=lambda event: overlay.quit())
except InvalidKeyError:
        sys.exit()
print('IT WENT HERE')

above code will continue and will not execute sys.exit()

jezztify avatar Dec 22 '21 09:12 jezztify