check for KeyError (fix #311)
This commit is contained in:
		
							parent
							
								
									98248632b7
								
							
						
					
					
						commit
						6f6f45d07b
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -182,6 +182,8 @@ class Dispatcher(PlugIn):
 | 
			
		|||
        """ Unregister handler. "typ" and "ns" must be specified exactly the same as with registering."""
 | 
			
		||||
        if not xmlns: xmlns=self._owner.defaultNamespace
 | 
			
		||||
        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]:
 | 
			
		||||
            if handler==pack['func']: break
 | 
			
		||||
        else: pack=None
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue