From 6cb6c403f1895553d8637c0e8d219cd632455403 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Wed, 25 Nov 2020 09:37:15 +0000 Subject: [PATCH] topotests: python3, replace execfile with exec python3 does not support execfile implementation. replace it with open and exec api that are available in both python 2 and 3 implementations. Signed-off-by: Philippe Guibert --- tests/topotests/lib/lutil.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/topotests/lib/lutil.py b/tests/topotests/lib/lutil.py index 1fb4f48b0f..0b46363edd 100644 --- a/tests/topotests/lib/lutil.py +++ b/tests/topotests/lib/lutil.py @@ -380,7 +380,8 @@ def luInclude(filename, CallOnFail=None): LUtil.setCallOnFail(CallOnFail) if filename.endswith(".py"): LUtil.log("luInclude: execfile " + tstFile) - execfile(tstFile) + with open(tstFile) as infile: + exec(infile.read()) else: LUtil.log("luInclude: execTestFile " + tstFile) LUtil.execTestFile(tstFile) -- 2.39.5