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


Groups > comp.lang.python > #95168 > unrolled thread

Re: except block isn't catching exception

Started byCameron Simpson <cs@zip.com.au>
First post2015-08-08 19:02 +1000
Last post2015-08-08 19:02 +1000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#95168 — Re: except block isn't catching exception

FromCameron Simpson <cs@zip.com.au>
Date2015-08-08 19:02 +1000
SubjectRe: except block isn't catching exception
Message-ID<mailman.1335.1439024589.3674.python-list@python.org>
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>

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web