1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

python: fix pytest-cov false warnings by using compile() with full file path in exec_file_wrapper

This commit is contained in:
Akash Arunkumar
2025-11-27 17:31:05 +00:00
parent 2cf9c68da0
commit 13210cbb1d
@@ -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)