fix wscripts to work with python3.
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 6 Jul 2015 14:05:49 +0000 (10:05 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 6 Jul 2015 14:06:06 +0000 (10:06 -0400)
encode/decode return byte arrays in python3, not strings

wscript

diff --git a/wscript b/wscript
index cb01228be9b401fb8e758de1906906c46c5ec670..7d806858a06ac99497a6a0a7687b0eccb4028b80 100644 (file)
--- a/wscript
+++ b/wscript
@@ -180,9 +180,11 @@ else:
 
 V = MAJOR + '.' + MINOR + '.' + MICRO
 # Ensure that these are not unicode, which
-# can cause odd problems elsewhere
-VERSION = V.encode ('ascii', 'ignore')
-PROGRAM_VERSION = MAJOR.encode ('ascii', 'ignore')
+# can cause odd problems elsewhere. Note that
+# in python3, encode and decode do not return
+# strings, so we have to force the type.
+VERSION = str (V.encode ('ascii', 'ignore'))
+PROGRAM_VERSION = str (MAJOR.encode ('ascii', 'ignore'))
 
 # Mandatory variables
 top = '.'