jaraco / irc

Full-featured Python IRC library for Python.
MIT License
392 stars 87 forks source link

execute_every in 7.1 error #13

Closed jaraco closed 8 years ago

jaraco commented 8 years ago

I am unable to use the execute_every function. With whatever parameters I try, I always get this error:

#!python

File "ircbot.py", line 17, in __init__
    self.ircobj.execute_every( 60, myfunction )
File "myproject\irc\client.py", line 346, in execute_every
    command = schedule.PeriodicCommand(period, function, arguments)
File "myproject\irc\schedule.py", line 61, in __init__
    super(PeriodicCommand, self).__init__(*args, **kwargs)
TypeError: object.__init__() takes no parameters

ircbot.py contains my program, and the irc folder contains irclib. The reason might be my incompetence and I am on Python 3.3. execute_delayed for example works fine.


jaraco commented 8 years ago

This is a tricky one. That code works and is tested on Python 2.7, but when I run the tests with Python 3.3, it fails with the error you describe. I'm not clear why, though. It has something to do with the 'super' invocation. I'll continue to investigate.


Original comment by: Jason R. Coombs

jaraco commented 8 years ago

Added init method to DelayedCommand. Fixes #13

→ <<cset 2c1b6a752401>>


Original comment by: Jason R. Coombs

jaraco commented 8 years ago

Both irc 7.1.2 and 8.0 address this issue.


Original comment by: Jason R. Coombs