Nick Coghlan added the comment:

Yeah, I was already thinking the lookaside table might be a better idea 
(similar to co_lnotab replacing the old SET_LINENO opcodes), especially since 
that would also provide a quick way of introspecting code objects to see if 
they included any try/finally constructs. The special case was just a quick 
check to see if the problem was what I thought it was.

That's also a good point regarding __aexit__ (I figured out that was the 
problem in the sync case, but hadn't realised it also applied to the async 
case), so I'll restore those tests and opcode updates.

I'm also wondering how far we might be able to get by adjusting the pending 
signal processing such that we always execute at least one line from a function 
before checking for pending signals (that should be enough to protect the 
test's __aexit__, and it would also be enough to get inside a with statement 
that guarded a function body against signals).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue29988>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to