From c0d7aad0691f4f7aa826bfaffc72cfe968d74dd4 Mon Sep 17 00:00:00 2001 From: Mikkel Krautz Date: Tue, 29 Jul 2014 23:18:56 +0200 Subject: [PATCH] scripts/gen-mumble_app-qt-def.py: add Python 3 compatibility. --- scripts/gen-mumble_app-qt-def.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/gen-mumble_app-qt-def.py b/scripts/gen-mumble_app-qt-def.py index f18324095..91a68f4cb 100755 --- a/scripts/gen-mumble_app-qt-def.py +++ b/scripts/gen-mumble_app-qt-def.py @@ -42,6 +42,8 @@ # future, since the current iteration is likely to produce unneeded # exports. +from __future__ import (unicode_literals, print_function, division) + import subprocess import sys import re @@ -110,6 +112,11 @@ def processExports(f, libs, symbols): if p.returncode != 0: raise Exception('dumpbin.exe failed: %s', stderr) + if stdout is not None: + stdout = stdout.decode('utf-8') + if stderr is not None: + stderr = stderr.decode('utf-8') + symbol_re = re.compile('^.*\ (.*(%s)+?.*)$' % '|'.join(symbols)) f.write('EXPORTS\n\n') @@ -124,7 +131,7 @@ def processExports(f, libs, symbols): def main(): if len(sys.argv) < 4: - print 'Usage: gen-mumble_app-qt-def.py ' + print('Usage: gen-mumble_app-qt-def.py ') sys.exit(1) kind = sys.argv[1]