RE: [PyOpenGL-Users] Have exceptions terminate glutMainLoop
Brought to you by:
mcfletch
|
From: Tarn W. B. <twb...@ph...> - 2001-10-07 14:39:22
|
Because of the mechanics of the callback execution model we can't pass exceptions through it. For consistency I think that any change in callback behavior should apply to all callbacks, not just GLUT callbacks embedded in glutMainLoop. In fact, the exception behavior really has nothing to do with glutMainLoop since the change actually occurs in the C callback which executes the user's Python callback. Because of the execution model of callbacks it's better to think of a callback as a separate thread of execution which the main thread waits on. In Python's threading model, an unhandled exception in a child thread would never cause the parent thread to terminate. Instead Python would print a traceback and terminate the child thread. In the current setup it's still possible to do what Richard wants to do by having the user supply their own try blocks. Which brings up the point, that user's should be providing a try block anyway. The current implementation is only the bare minimum needed to make sys.exit work. Tarn |