multipart-message nevyn bengtsson's blog

featured articles 🦄, about, archive, tags

no title


Voxar is “between jobs”. That’s an eupherism for “working all day on hobby projects”. Like Deathtroid networking. I added some sounds, too.

We seem to be running into some sort of pyglet bug though, where the timer makes us crash.


Traceback (most recent call last):
  File "src/main.py", line 295, in 
    pyglet.app.EventLoop().run()
  File "/Library/Python/2.5/site-packages/pyglet/app/carbon.py", line 84, in run
    self._timer_proc(timer, None, False)
  File "/Library/Python/2.5/site-packages/pyglet/app/carbon.py", line 133, in _timer_proc
    sleep_time = self.idle()
  File "/Library/Python/2.5/site-packages/pyglet/app/__init__.py", line 187, in idle
    dt = clock.tick(True)
  File "/Library/Python/2.5/site-packages/pyglet/clock.py", line 698, in tick
    return _default.tick(poll)
  File "/Library/Python/2.5/site-packages/pyglet/clock.py", line 317, in tick
    item.next_ts = self._get_soft_next_ts(ts, item.interval)
  File "/Library/Python/2.5/site-packages/pyglet/clock.py", line 585, in _get_soft_next_ts
    if not taken(next_ts, interval / 4):
  File "/Library/Python/2.5/site-packages/pyglet/clock.py", line 563, in taken
    if abs(item.next_ts - ts) <= e:
TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'
I ugly-patched it like this:

--- clock.py	2009-04-06 22:20:44.000000000 +0200
+++ clock-uglypatched.py	2009-04-06 20:55:46.000000000 +0200
@@ -560,6 +560,8 @@
             scheduled nearby.
             '''
             for item in self._schedule_interval_items:
+                if item.next_ts == None:
+                  continue
                 if abs(item.next_ts - ts)  ts + e:

I’m guessing a schedule item shouldn’t be allowed to have a next_ts == None at this point.

Update: This bug is known under issue 407 on their bug tracker.

Tagged deathtroid