summaryrefslogtreecommitdiffstats
path: root/python_modules/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
commit3cc9566a00cb4deb1ead414c390a29beaccc0bd0 (patch)
treed4f10a324c3193c7420b40064c2317d5980cd10e /python_modules/codegen.py
parente919337980c45fb4bc907cf40cdd106fb8f32d92 (diff)
downloadspice-protocol-3cc9566a00cb4deb1ead414c390a29beaccc0bd0.tar.gz
spice-protocol-3cc9566a00cb4deb1ead414c390a29beaccc0bd0.tar.xz
spice-protocol-3cc9566a00cb4deb1ead414c390a29beaccc0bd0.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 'python_modules/codegen.py')
-rw-r--r--python_modules/codegen.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/python_modules/codegen.py b/python_modules/codegen.py
index 55f513b..f324498 100644
--- a/python_modules/codegen.py
+++ b/python_modules/codegen.py
@@ -121,10 +121,10 @@ class CodeWriter:
def write(self, s):
# Ensure its a unicode string
- if six.PY2:
- s = unicode(s)
- else:
+ if six.PY3:
s = str(s)
+ else:
+ s = unicode(s)
if len(s) == 0:
return