workaround pylint warnings
diff --git a/src/python/oftest/testutils.py b/src/python/oftest/testutils.py
index 1d56f79..e587633 100644
--- a/src/python/oftest/testutils.py
+++ b/src/python/oftest/testutils.py
@@ -943,10 +943,8 @@
     except:
         return default
 
-    s = "val = " + str(key)
     try:
-        exec s
-        return val
+        return eval(str(key))
     except:
         return default
 
@@ -1211,10 +1209,11 @@
     out = None
     backup = sys.stdout
     try:
-        sys.stdout = StringIO()
+        tmp = StringIO()
+        sys.stdout = tmp
         pkt.show2()
-        out = sys.stdout.getvalue()
-        sys.stdout.close()
+        out = tmp.getvalue()
+        tmp.close()
     finally:
         sys.stdout = backup
     return out