dispatcher.addHandler(): validate value of group is int

This commit is contained in:
Noam Meltzer 2016-04-25 10:44:55 +03:00
parent 856f4460fc
commit 1f83e7ae4e

View file

@ -220,6 +220,8 @@ class Dispatcher(object):
if not isinstance(handler, Handler): if not isinstance(handler, Handler):
raise TypeError( raise TypeError(
'handler is not an instance of {0}'.format(Handler.__name__)) 'handler is not an instance of {0}'.format(Handler.__name__))
if not isinstance(group, int):
raise TypeError('group is not int')
if group not in self.handlers: if group not in self.handlers:
self.handlers[group] = list() self.handlers[group] = list()