tests/misc/sys_settrace_features.py: Fix running with non-dflt encoding.

Notably git-cmd which comes with git installations on Windows alters the
encoding resulting in CPython tracing encodings/cp1252.py calls.
This commit is contained in:
stijn 2020-12-15 12:03:42 +01:00 committed by Damien George
parent 108183fcc0
commit 069557edef
1 changed files with 2 additions and 1 deletions

View File

@ -60,8 +60,9 @@ def trace_tick_handler_bob(frame, event, arg):
def trace_tick_handler(frame, event, arg):
# Ignore CPython specific helpers.
to_ignore = ["importlib", "zipimport", "encodings"]
frame_name = frame.f_globals["__name__"]
if frame_name.find("importlib") != -1 or frame_name.find("zipimport") != -1:
if any(name in frame_name for name in to_ignore):
return
print("### trace_handler::main event:", event)