Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Crashed

Pages: [1]
1
Python / Re: python-sfml strange behaviour
« on: October 09, 2013, 01:47:54 pm »
I apologize for the ambiguous title, my brain had gone to mush after trying to debug a larger application with tracebacks suppressed. For some more strange behaviour:

import sfml as sf

window = sf.RenderWindow(sf.VideoMode(640, 480), 'Test')

class DummyDrawable(sf.Drawable):
        def draw(self, *args, **kwargs):
                print 'draw'
                raise Exception('Sample exception')

dummy = DummyDrawable()

while window.is_open:
        for event in window.events:
                if isinstance(event, sf.CloseEvent):
                        window.close()

        window.draw(dummy)

print 'Finished'
 

draw
draw
draw
Finished
Exception Exception: Exception('Sample exception',) in <module 'threading' from C:\...\Python27\lib\threading.pyc'> ignored
 


Only the dummy's draw method causes this, throwing an exception anywhere else will halt execution as is normal. I've read over the python-sfml source from github, unless the code there is very different to the precompiled binary I installed then I assert there is voodoo magic at play here.

2
Python / [Solved] Exceptions not propagated
« on: October 09, 2013, 04:41:23 am »
import sfml as sf

window = sf.RenderWindow(sf.VideoMode(640, 480), 'Test')

class DummyDrawable(sf.Drawable):
        def draw(self, *args, **kwargs):
                print 'draw'
                raise Exception('Sample exception')

dummy = DummyDrawable()

for x in xrange(10):
        print x

        window.draw(dummy)

print 'Finished'
 


0
draw
1
draw
2
draw
3
draw
4
draw
5
draw
6
draw
7
draw
8
draw
9
draw
Traceback (most recent call last):
  File "C:\...\wtf.py", line 12, in <module>
    for x in xrange(10):
  File "C:\...\wtf.py", line 8, in draw
    raise Exception('Sample exception')
Exception: Sample exception
 

pySFML-1.3.0.win32-py2.7, encountering strange issues with threading (putting this in a while loop will instead suppress error messages until after 'Finished', with a traceback coming from threading module). I've read over the source code to python-sfml and tried to debug with pdb and I cannot for the life of me understand what the hell is going on. I'm at the edge of insanity, please advise.

Pages: [1]