mikemalinowski / qute

A Qt helper library extending Marcus Ottosson's Qt.py library
MIT License
12 stars 3 forks source link

Minor: tray.ProcessorThread may undesirably catch all exceptions - including KeyboardInterrupt, SystemExit etc #11

Closed ldunham1 closed 4 years ago

ldunham1 commented 4 years ago

https://github.com/mikemalinowski/qute/blob/3c5e1c34eba7153ba564910963f5c48c7abd1b4c/qute/extensions/tray.py#L409

Not sure of the benefit of catching all exceptions, but except Exception is usually intended instead. I would be interesting in understanding the benefit in this case if this is desirable.

mikemalinowski commented 4 years ago

switch to (Exception, RuntimeError)

ldunham1 commented 4 years ago

RuntimeError inherits Exception, so just use exception :)

print(RuntimeError.__mro__)
(<type 'exceptions.RuntimeError'>, <type 'exceptions.StandardError'>, <type 'exceptions.Exception'>, <type 'exceptions.BaseException'>, <type 'object'>)
mikemalinowski commented 4 years ago

aaah ... i am such a noob, thanks for pointing that out! I will get it changed