3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-24 03:29:28 +01:00

pr/inspircd: catch KeyError only in the function lookup, not the function call!

This suppressed KeyErrors in execution... BAD
This commit is contained in:
James Lu 2015-07-05 12:38:55 -07:00
parent dafeff6324
commit 2ecaab1586

View File

@ -419,9 +419,10 @@ def handle_events(irc, data):
# We will do wildcard event handling here. Unhandled events are just ignored.
try:
func = globals()['handle_'+command.lower()]
parsed_args = func(irc, numeric, command, args)
except KeyError: # unhandled event
pass
else:
parsed_args = func(irc, numeric, command, args)
else:
# Only call our hooks if there's data to process. Handlers that support
# hooks will return a dict of parsed arguments, which can be passed on