X-Git-Url: https://git.distorted.org.uk/~mdw/tripe/blobdiff_plain/e41b17c85e858097cf8c077287c4744dd139f3b5..HEAD:/py/rmcr.py diff --git a/py/rmcr.py b/py/rmcr.py index f73a6cc9..6c846cb8 100644 --- a/py/rmcr.py +++ b/py/rmcr.py @@ -9,19 +9,18 @@ ### ### This file is part of Trivial IP Encryption (TrIPE). ### -### TrIPE is free software; you can redistribute it and/or modify -### it under the terms of the GNU General Public License as published by -### the Free Software Foundation; either version 2 of the License, or -### (at your option) any later version. +### TrIPE is free software: you can redistribute it and/or modify it under +### the terms of the GNU General Public License as published by the Free +### Software Foundation; either version 3 of the License, or (at your +### option) any later version. ### -### TrIPE is distributed in the hope that it will be useful, -### but WITHOUT ANY WARRANTY; without even the implied warranty of -### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -### GNU General Public License for more details. +### TrIPE is distributed in the hope that it will be useful, but WITHOUT +### ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +### FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +### for more details. ### ### You should have received a copy of the GNU General Public License -### along with TrIPE; if not, write to the Free Software Foundation, -### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +### along with TrIPE. If not, see . __pychecker__ = 'self=me' @@ -29,7 +28,7 @@ __pychecker__ = 'self=me' ### External dependencies. import thread as T -from sys import exc_info +from sys import exc_info, excepthook ###-------------------------------------------------------------------------- ### What's going on? @@ -51,7 +50,7 @@ def _switchto(cr, arg = None, exc = None): global active _debug('> _switchto(%s, %s, %s)' % (cr, arg, exc)) if not cr.livep: - raise ValueError, 'coroutine is dead' + raise ValueError('coroutine is dead') cr._arg = arg cr._exc = exc if cr is active: @@ -134,11 +133,11 @@ class Coroutine (object): try: _debug(' _start(%s): call user (args = %s, kwargs = %s)' % (me, args, kwargs)) - me._func(*args, **kwargs) + me._onexit = [me._func(*args, **kwargs), None] except: exc = exc_info() _debug(' _start(%s): caught exception (%s)' % (me, exc)) - _switchto(findvictim(me.parent), None, exc) + me._onexit = [None, exc] finally: _debug(' _start(%s): finally' % me) _debug(' _start(%s): _onexit = %s' % (me, me._onexit))