On Dec 2, 2007 11:29 AM, Chad Austin <[EMAIL PROTECTED]> wrote: > Hi Antoine, > > Antoine Pitrou wrote: > > Hi, > > > > (I was asked to forward this from the bug tracker) > > > >> We have also run into problems where a task tries to "return" (yield > >> Return()) > >> from within a try: except Exception: block. Since returning from a > >> coroutine is > >> roughly equivalent to "raise GeneratorExit", the exception can be caught > >> and > >> ignored, with the same consequences as above. > > > > I may be missing something but why don't you just catch StandardError > > instead? If I believe Python 2.5's exception hierarchy it would catch > > anything under Exception except for GeneratorExit, StopIteration and the > > various Warnings. > > If socket.error, xmlrpclib.Fault, httplib.HTTPException, etc. all extended > StandardError, then we would probably be fine with that approach. But I think > the majority of exceptions, both in the standard library and our code, extend > Exception directly.
Note that StandardError was removed from py3k. n _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com