Carl Friedrich Bolz-Tereick pushed to branch branch/py3.9 at PyPy / pypy


Commits:
92100c0e by Carl Friedrich Bolz-Tereick at 2022-02-19T11:19:14+01:00
#3673: I am not 100% sure this fixes the remaining trace hook problems, but it
has a pretty decent chance. approach is a bit different than CPython, but
CPython's approach has problems (broken in 3.9) and is very complicated.

the main problem is that for except Cls as name:
there is an artificial try: finally: block like this:

except Cls as name:
    try:
        ... # user-written code
    finally:
        name = None; del name

we never want to trace that finally, because it has the line number of the last
line in the user-written content of the except block. what I implement here is
to add a NOP in the artificial finally, and use that to detect this case and
not trigger a line trace event then.

--HG--
branch : py3.9

- - - - -


4 changed files:

- pypy/interpreter/astcompiler/codegen.py
- pypy/interpreter/pycode.py
- pypy/interpreter/pyopcode.py
- pypy/interpreter/test/apptest_pyframe.py


View it on Heptapod: 
https://foss.heptapod.net/pypy/pypy/-/commit/92100c0eb5147c040732cf4157e6c4e6643bd982

-- 
View it on Heptapod: 
https://foss.heptapod.net/pypy/pypy/-/commit/92100c0eb5147c040732cf4157e6c4e6643bd982
You're receiving this email because of your account on foss.heptapod.net.


_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to