sys.settrace issue (bug?)
Hi,
when I have the following code
def test():
for a in range(10):
if a == 7:
print("it worked")
print("again")
print("or not.")
test()
then sys.settrace fires at the line containing print("or not.") even if the condition a==7 is False.
for the debugger I am writing, see https://github.com/wolfc01/micropython_debugger/blob/main/debugger.py
Probably this has to do with entering or leaving some local scope?
When I run the very same debugger and example in python 3, above effect does not occur.
Best regards
Carl.
RFC tests: Make settrace test work on a wider range of machines.
Depending on type and version of installation the CPython output
can include 'zipimport' as well, next to the 'importlib' frames.
And on Windows the path reduction needs to deal with the different
path separator.
RFC part: this isn't completely ready yet in that the path reduction logic will still fail when running tests like
run-tests -d .\misc
because then there's no tests/misc in the path at all.
Also the current logic in sys_settrace_loop.py and sys_settrace_generator.py isn't actually needed I think, because co_filename isn't a full path in those tests.
Does this need fixing?