From 069557edef84a4f37ad52ae93838129da8e5fe77 Mon Sep 17 00:00:00 2001 From: stijn Date: Tue, 15 Dec 2020 12:03:42 +0100 Subject: [PATCH] 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. --- tests/misc/sys_settrace_features.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/misc/sys_settrace_features.py b/tests/misc/sys_settrace_features.py index e1b1a059da..8a38b7534f 100644 --- a/tests/misc/sys_settrace_features.py +++ b/tests/misc/sys_settrace_features.py @@ -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)