Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #95168

Re: except block isn't catching exception

Date 2015-08-08 19:02 +1000
From Cameron Simpson <cs@zip.com.au>
Subject Re: except block isn't catching exception
References <CAPTjJmrtKFrQmu0GdU-Nj0rdfBPvv1dj8+ZzSLTk1HKJix2PgQ@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1335.1439024589.3674.python-list@python.org> (permalink)

Show all headers | View raw


On 08Aug2015 18:17, Chris Angelico <rosuav@gmail.com> wrote:
>On Sat, Aug 8, 2015 at 6:11 PM, Cameron Simpson <cs@zip.com.au> wrote:
>> From:
>>
>>
>> https://docs.python.org/3/library/signal.html#execution-of-python-signal-handlers
>>
>> we have:
>>
>>  A Python signal handler does not get executed inside the low-level (C)
>> signal  handler. Instead, the low-level signal handler sets a flag which
>> tells the  virtual machine to execute the corresponding Python signal
>> handler at a later  point(for example at the next bytecode instruction).
>
>Ah, thanks. Most importantly, though: Is there anything in the
>*language spec*, or is this a CPython implementation detail?

Signals aren't part of the language spec, surely? Though part of the stdlib 
clearly.

I'd say the above text from the signal module doco was written from the 
viewport of CPython, though it is loose enough in terminology (==> allows 
freedom to implementors) to read like generic Python spec than CPython detail.

The other bit of text I quoted:

  Python signal handlers are always executed in the main Python thread, even
  if the signal was received in another thread.

also reads like specification.

No, I can't prove any of this. It is just how I read the signal module 
documentation.

Cheers,
Cameron Simpson <cs@zip.com.au>

No good deed shall go unpunished!       - David Wood <davewood@teleport.com>

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: except block isn't catching exception Cameron Simpson <cs@zip.com.au> - 2015-08-08 19:02 +1000

csiph-web