summaryrefslogtreecommitdiff
path: root/test/gen-wasm.py
diff options
context:
space:
mode:
authorBen Smith <binji@chromium.org>2016-08-30 16:42:42 -0700
committerBen Smith <binji@chromium.org>2016-09-01 11:58:17 -0700
commita0a53eace2efd3e07cb584cd6f360058bb4dce17 (patch)
tree75b9068c8376641a7f996bfa8654eea53259af36 /test/gen-wasm.py
parente771a3b9d3ac4ea19ff3be45983276b844213d4e (diff)
downloadwabt-a0a53eace2efd3e07cb584cd6f360058bb4dce17.tar.gz
wabt-a0a53eace2efd3e07cb584cd6f360058bb4dce17.tar.bz2
wabt-a0a53eace2efd3e07cb584cd6f360058bb4dce17.zip
python3 support
Diffstat (limited to 'test/gen-wasm.py')
-rwxr-xr-xtest/gen-wasm.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/gen-wasm.py b/test/gen-wasm.py
index e0201e0c..325ebee9 100755
--- a/test/gen-wasm.py
+++ b/test/gen-wasm.py
@@ -15,8 +15,8 @@
# limitations under the License.
#
+from __future__ import print_function
import argparse
-import cStringIO
import os
import struct
import sys
@@ -294,7 +294,7 @@ def t_newline(t):
t.lexer.lineno += len(t.value)
def t_error(t):
- print "Illegal character '%s'" % t.value[0]
+ print("Illegal character '%s'" % t.value[0])
t.lexer.skip(1)
lexer = lex.lex()
@@ -426,7 +426,7 @@ def p_data_empty(p):
p[0] = []
def p_error(p):
- print '%d: syntax error, %s' % (p.lineno, p)
+ print('%d: syntax error, %s' % (p.lineno, p))
parser = yacc.yacc(tabmodule='gen_wasm', debugfile='gen_wasm_debug.txt',
outputdir=OUT_DIR)
@@ -437,8 +437,8 @@ def Run(input_file_name):
with open(input_file_name) as input_file:
input_data = input_file.read()
data = parser.parse(input_data)
- # convert to string
- data = ''.join(chr(x) for x in data)
+ # convert to bytes
+ data = bytearray(data)
return data
def main(args):