3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-28 05:29:25 +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. # We will do wildcard event handling here. Unhandled events are just ignored.
try: try:
func = globals()['handle_'+command.lower()] func = globals()['handle_'+command.lower()]
parsed_args = func(irc, numeric, command, args)
except KeyError: # unhandled event except KeyError: # unhandled event
pass pass
else:
parsed_args = func(irc, numeric, command, args)
else: else:
# Only call our hooks if there's data to process. Handlers that support # 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 # hooks will return a dict of parsed arguments, which can be passed on