New submission from Alexander Belopolsky <alexander.belopol...@gmail.com>:

Consider the following code:

import sys

def trace(frame, event, arg):
    pass

def f():
    f()
sys.settrace(trace)
print(sys.gettrace())
try:
    f()
except RuntimeError:
    pass
print(sys.gettrace())

When I run it, I get

<function trace at 0x108865158>
None

Apparently, the infinite recursion somehow resets the trace function.  This 
interferes with the coverage tools.

----------
messages: 319409
nosy: belopolsky
priority: normal
severity: normal
stage: needs patch
status: open
title: Caught infinite recursion resets the trace function
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8

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

Reply via email to