Ticket #4301: 3k-internet-defer-4301.patch

File 3k-internet-defer-4301.patch, 665 bytes (added by drtimcouper, 5 years ago)
  • twisted/internet/defer.py

     
    239239 
    240240        These will be executed when the 'master' callback is run. 
    241241        """ 
    242         assert callable(callback) 
    243         assert errback == None or callable(errback) 
     242        assert hasattr(callback, '__call__') 
     243        assert errback is None or hasattr(errback, '__call__') 
    244244        cbs = ((callback, callbackArgs, callbackKeywords), 
    245245               (errback or (passthru), errbackArgs, errbackKeywords)) 
    246246        self.callbacks.append(cbs)