From 13210cbb1da281e03d65b566ff80c7e2f26a6fa4 Mon Sep 17 00:00:00 2001 From: Akash Arunkumar Date: Thu, 27 Nov 2025 17:31:05 +0000 Subject: [PATCH] python: fix pytest-cov false warnings by using compile() with full file path in exec_file_wrapper --- modules/python/package/cv2/load_config_py3.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/python/package/cv2/load_config_py3.py b/modules/python/package/cv2/load_config_py3.py index 6f3b21ab86..83a44d19ce 100644 --- a/modules/python/package/cv2/load_config_py3.py +++ b/modules/python/package/cv2/load_config_py3.py @@ -5,5 +5,5 @@ import sys if sys.version_info[:2] >= (3, 0): def exec_file_wrapper(fpath, g_vars, l_vars): with open(fpath) as f: - code = compile(f.read(), os.path.basename(fpath), 'exec') + code = compile(f.read(), fpath, 'exec') exec(code, g_vars, l_vars)