X-Git-Url: https://git.distorted.org.uk/~mdw/tripe/blobdiff_plain/2fa800105a5897cad85c51c48d1970b9061a33f5..0c614d591a785cdd6de98064582fcef596155fa5:/py/rmcr.py?ds=sidebyside diff --git a/py/rmcr.py b/py/rmcr.py index 61521b4d..e2c03252 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? @@ -134,9 +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: - _switchto(findvictim(me.parent), None, exc_info()) + exc = exc_info() + _debug(' _start(%s): caught exception (%s)' % (me, exc)) + me._onexit = [None, exc] finally: _debug(' _start(%s): finally' % me) _debug(' _start(%s): _onexit = %s' % (me, me._onexit))