[PATCH 06/14] cputest: Move instantiation of JSONDecoder in cpu-convert.py

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Let's make the object local to the parseFeatureWords function which uses
it.

Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 tests/cputestdata/cpu-convert.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/cputestdata/cpu-convert.py b/tests/cputestdata/cpu-convert.py
index 898d42f10..e069408c8 100755
--- a/tests/cputestdata/cpu-convert.py
+++ b/tests/cputestdata/cpu-convert.py
@@ -174,6 +174,8 @@ cpuidMap = [
 def parseFeatureWords(path):
     features = None
 
+    dec = json.JSONDecoder()
+
     with open(path, "r") as f:
         s = f.read()
 
@@ -220,8 +222,6 @@ def propAdd(props, feature, value):
         props[name] = value
 
 
-dec = json.JSONDecoder()
-
 for path in sys.argv[1:]:
     props, cpuid = parseFeatureWords(path)
 
-- 
2.12.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux