[virt-tools-list] [libvirt] [PATCH 14/22] python3: cpu-reformat: Use the print() function

Radostin Stoyanov rstoyanov1 at gmail.com
Sat Mar 17 13:48:50 UTC 2018


Replace the print statement, that is only available in Py2, with a
print function that is available in both Py2 and Py3 and drop the
explicit python version in the shebang.

Signed-off-by: Radostin Stoyanov <rstoyanov1 at gmail.com>
---
 tests/cputestdata/cpu-reformat.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/cputestdata/cpu-reformat.py b/tests/cputestdata/cpu-reformat.py
index 33976e775..d4ed8d811 100755
--- a/tests/cputestdata/cpu-reformat.py
+++ b/tests/cputestdata/cpu-reformat.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python
 
 import sys
 import json
@@ -6,4 +6,4 @@ import json
 dec = json.JSONDecoder()
 data, pos = dec.raw_decode(sys.stdin.read())
 json.dump(data, sys.stdout, indent=2, separators=(',', ': '))
-print
+print("\n")
-- 
2.14.3




More information about the virt-tools-list mailing list