[PEAK] Trellis WXEventLoop patch

Sergey Schetinin maluke at gmail.com
Wed Jun 25 12:25:39 EDT 2008


For me it crashes violently (with windows error) briefly showing a new
window with a traceback. It happens every single time. In the actual
application that traceback is captured and looks like this:

  File "C:\Python25\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py",
line 14404, in __init__
    self.Start()
  File "C:\Python25\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py",
line 14421, in Start
    self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
  File "C:\Python25\lib\site-packages\wx-2.8-msw-unicode\wx\_misc.py",
line 1298, in Start
    return _misc_.Timer_Start(*args, **kwargs)
PyAssertionError: C++ assertion "m_milli > 0" failed at
..\..\src\msw\timer.cpp(89) in wxTimer::Start(): invalid value for
timer timeout

The problem is that wx.CallLater first argument has to be a positive
integer, so if the activity event is less than 0.001 seconds from now
it will produce this error, so wx.CallAfter should be used in those
cases.

On Wed, Jun 25, 2008 at 18:15, Phillip J. Eby <pje at telecommunity.com> wrote:
> At 07:46 PM 6/21/2008 +0300, Sergey Schetinin wrote:
>>
>> from peak.events.trellis import *
>> from peak.events.activity import *
>>
>> import wx
>> app = wx.App()
>>
>> loop = WXEventLoop()
>> event = Time[0.00001]
>>
>> @Cell
>> def dependency():
>>    if event: pass
>>
>> dependency.value
>>
>> loop.run()
>
> This code simply goes into an infinite loop on my machine....  What does it
> do on yours?
>
> If I add other code to it (such as changing 'pass' to
> 'loop.call(loop.stop)', I can get it to randomly either loop or run
> correctly.  What I can't get it to do is produce any sort of test failure in
> a reliable fashion.
>
>



-- 
Best Regards,
Sergey Schetinin

http://s3bk.com/ -- S3 Backup
http://word-to-html.com/ -- Word to HTML Converter



More information about the PEAK mailing list