"for/while ... break(by any means) ... else" make sense?

Random832 random832 at fastmail.com
Thu Jun 30 00:00:14 EDT 2016


On Wed, Jun 29, 2016, at 22:26, Rustom Mody wrote:
> > os.kill(os.getpid(), 9)
> >
> > Now THAT is the hardest way to abort. You ain't comin' back from
> > this one!
>
> Is it?
>
> | On Windows, signal() can only be called with SIGABRT, SIGFPE,
> | SIGILL, SIGINT, SIGSEGV, or SIGTERM. A ValueError will be raised in
> | any other case.

And SIGBREAK (it being missing from this list is a doc bug).

> from https://docs.python.org/3.5/library/signal.html
>
> 9 may still work?? Dunno...

That's signal, not kill. You can call kill on Windows with any
integer. Only CTRL_C_EVENT and CTRL_BREAK_EVENT (which aren't, AIUI,
equal to SIGINT and SIGBREAK, which is unfortunate for cross-platform
code) do anything interesting, the rest call TerminateProcess with the
given value.


More information about the Python-list mailing list