[IronPython] Timer constructor fails on float

Idan Zaltzberg idan at cloudshare.com
Sun Dec 20 07:20:16 CET 2009


I recently encountered a problem when creating timers.

It seems that creating a timer with a floating point interval or delay
throws an exception:

>>> def _callback(n): pass


>>> timer = System.Threading.Timer(_callback, None, 100, 0) # Works fine

>>> timer = System.Threading.Timer(_callback, None, 100.1, 0) # Throws

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

TypeError: expected TimerCallback, got function

How can I solve this?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20091220/c54da158/attachment.html>

More information about the Ironpython-users mailing list