[Twisted-Python] MetaInterface call error

Jp Calderone exarkun at intarweb.us
Sun Oct 19 15:49:53 MDT 2003


On Sun, Oct 19, 2003 at 06:43:16PM -0300, Rita D?az y/o Rodrigo Benenson wrote:
> Hi!,
> 
> the log crash problem was solved as indicated (thanks !), just had to fix
> the calls to thread.start_new_thread(reactor.run, ()).
> I'm still working to get Khashmir passing the unit tests (again, I suppose).
> After some grumble grumbling I discovered the following funny situation
> (copied from another screen):
> 
> 
> >>> import airhook
> >>> a = airhook.AirhookConnection
> >>> a
> <class 'airhook.AirhookConnection'>
> >>> b = a()
> TypeError: __call__() takes at least 2 arguments (1 given)
> 
> Why __call__? __init__ should be called !
> 
> AirhookConnection is defined as:
> 
> class AirHookConnection(protocol.ConnectedDatagramProtocol,
> interfaces.IUDPConnectedTransport):
>    def __init__(self):
>       blablblah

  This seems to be an error.  AirHookConnection should not inherit from
IUDPConnectedTransport.  It may have worked with a previous version of
Twisted, but doing this was never supported, and won't work with any
reasonably recent release of Twisted.  Simply removing it from the base
class list should resolve the issue.  If you want to be clean about it, add
this line to the body of the AirHookConnection class definition:

    __implements__ = (interfaces.IUDPConnectedTransport,)

  Jp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: </pipermail/twisted-python/attachments/20031019/627e539c/attachment.sig>


More information about the Twisted-Python mailing list