Skip to content

Fix bare except: use except Exception in call_error_handler#292

Open
koteshyelamati wants to merge 1 commit into
python-xlib:masterfrom
koteshyelamati:master
Open

Fix bare except: use except Exception in call_error_handler#292
koteshyelamati wants to merge 1 commit into
python-xlib:masterfrom
koteshyelamati:master

Conversation

@koteshyelamati

Copy link
Copy Markdown

Replace bare except: with except Exception: in Xlib/protocol/rq.py.

In call_error_handler(), the bare except: catches any exception from a user-supplied error handler callback, logs it to stderr, and returns 0. Using except Exception: is more precise and prevents accidentally catching SystemExit or KeyboardInterrupt from user callbacks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant