[IronPython] Timer constructor fails on float

Idan Zaltzberg idan at cloudshare.com
Sat Dec 19 22:20:16 PST 2009


Hi,

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
exception

Traceback (most recent call last):

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

TypeError: expected TimerCallback, got function



How can I solve this?

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ironpython.com/pipermail/users-ironpython.com/attachments/20091220/c54da158/attachment.htm>


More information about the Users mailing list