check for KeyError (fix #311)
This commit is contained in:
parent
98248632b7
commit
6f6f45d07b
|
@ -182,6 +182,8 @@ class Dispatcher(PlugIn):
|
||||||
""" Unregister handler. "typ" and "ns" must be specified exactly the same as with registering."""
|
""" Unregister handler. "typ" and "ns" must be specified exactly the same as with registering."""
|
||||||
if not xmlns: xmlns=self._owner.defaultNamespace
|
if not xmlns: xmlns=self._owner.defaultNamespace
|
||||||
if not typ and not ns: typ='default'
|
if not typ and not ns: typ='default'
|
||||||
|
if not self.handlers[xmlns].has_key(name): return
|
||||||
|
if not self.handlers[xmlns][name].has_key(typ+ns): return
|
||||||
for pack in self.handlers[xmlns][name][typ+ns]:
|
for pack in self.handlers[xmlns][name][typ+ns]:
|
||||||
if handler==pack['func']: break
|
if handler==pack['func']: break
|
||||||
else: pack=None
|
else: pack=None
|
||||||
|
|
Loading…
Reference in New Issue