summaryrefslogtreecommitdiffstats
path: root/spice_codegen.py
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2015-04-14 16:08:43 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2015-04-14 16:08:43 +0200
commitb216f66f108b14b67b8cb2f9a3d2caee0ec8e0fd (patch)
tree59383d30bf3423a3fb13e8e3da5582d2cc698513 /spice_codegen.py
parent838ec7d87b5311843a7214fe946471fadd5d8908 (diff)
downloadspice-common-b216f66f108b14b67b8cb2f9a3d2caee0ec8e0fd.tar.gz
spice-common-b216f66f108b14b67b8cb2f9a3d2caee0ec8e0fd.tar.xz
spice-common-b216f66f108b14b67b8cb2f9a3d2caee0ec8e0fd.zip
codegen: Use six.PY3 rather than six.PY2
Older versions of python-six (at least 1.3.0) defined six.PY3 but not six.PY2. six.PY2 is only used twice in straightforward tests so it's easy to use six.PY3 instead.
Diffstat (limited to 'spice_codegen.py')
-rwxr-xr-xspice_codegen.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/spice_codegen.py b/spice_codegen.py
index 16ad478..84790af 100755
--- a/spice_codegen.py
+++ b/spice_codegen.py
@@ -265,10 +265,10 @@ if options.keep_identical_file:
pass
f = open(dest_file, 'wb')
-if six.PY2:
- f.write(content)
-else:
+if six.PY3:
f.write(bytes(content, 'UTF-8'))
+else:
+ f.write(content)
f.close()
six.print_("Wrote %s" % dest_file)