> > > Hello Stackless, > > This my first use of the stackless mailing list, so please let me know if the > list is not for the kind of questions I am asking. > > I have been working with stackless for a couple of days and i noticed > something strange with exceptions: > > ----------------------------------------------------------------------------------------------- > class TaskletManager(object): > > schedule_channel = stackless.channel() > schedule_channel.preference = 1 > > @classmethod > def mainloop(cls, world): > cls.world = world.instance() # <= creates tasklets > cls.world.command = 'GO' > try: > while True: > stackless.run() # <= somewhere an exception is raised and not > caught by my code > cls.reschedule() > except Exception, e: > print 'stackless ended by Exception:\n', e .message # <= > doesn't catch exception > > @classmethod > def schedule(cls): > cls.schedule_channel.receive() > > @classmethod > def reschedule(cls): > while cls.schedule_channel.balance < 0: > cls.schedule_channel.send(None) > ------------------------------------------------------------------------------------------------- > > Running "mainloop" above (based on the pumping pattern in the documentation) > leads to a printout of the exception stack (uncaught in the code above). > After that at least one tasklet keeps running. > > Why does this happen? > > In a related question, i am trying to define unit tests for my code, and > between tests would like to kill/remove/empty the stackless scheduler, e.g. > in tearDown. What is the easiest way to do this (the exception above seems > not the way to go ;-) ? > > I am working (since today) with Wingware as IDE (the only IDE with stackless > debug support?) > > Cheers, Lars
_______________________________________________ Stackless mailing list [email protected] http://www.stackless.com/mailman/listinfo/stackless
