On Thu, Jun 12, 2003 at 04:07:33PM -0400, Guido van Rossum wrote: > > I haven't looked, but is it possible to make it raise an arbitrary > > exception? Last time I read the PyErr_CheckSignals code it looked possible. > > (That was yesterday, actually, regarding problems with the SSL module and > > KeyboardInterrupts). > > The interrupt module currently uses PyErr_SetInterrupt(), which can > only raise KeyboardInterrupt. > > Let's not generalize this until there's a need. Then, let whoever has > the need add the generalization. > > I'm actually a bit wary of such a generalization, because > KeyboardInterrupt is currently the only *asynchronous* exception that > code needs to worry about. There is plenty of code that gives > KeyboardInterrupt special treatment, typically of the form: > > while MoreWorkToDo: > try: > ...run a chunk of work which may raise arbitrary exceptions... > except KeyboardInterrupt: > raise # Don't keep going in this case > except: > ...report the error and continue... What about SystemExit? Neal
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4