From 1f833c032f18fa44ce846e82224191d492e5ac73 Mon Sep 17 00:00:00 2001 From: TheVice Date: Sun, 17 Mar 2019 13:48:22 +0200 Subject: [PATCH] [parse_xml] resolved "TypeError: a bytes-like object is required, not 'str'" after commit 10f2d76c62b2361329830b1f1d99e6226e7754c5 was applied. --- auto/bin/parse_xml.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/auto/bin/parse_xml.py b/auto/bin/parse_xml.py index 88cee2c..2bcefc9 100755 --- a/auto/bin/parse_xml.py +++ b/auto/bin/parse_xml.py @@ -98,7 +98,7 @@ def findApi(dom, name): isWGL = re.compile('WGL_([A-Z0-9]+)_.*') def writeExtension(f, name, extension, enums, commands): - f.write('%s\n'%name) + f.write(('%s\n'%name).encode()) url = 'https://www.khronos.org/registry/egl/specs/eglspec.1.5.pdf' @@ -106,24 +106,24 @@ def writeExtension(f, name, extension, enums, commands): if m: url = 'https://www.khronos.org/registry/OpenGL/extensions/%s/%s.txt'%(m.group(1), name) - f.write('%s\n'%(url)) + f.write(('%s\n'%(url)).encode()) if name.find('_VERSION_')==-1: - f.write('%s\n'%name) + f.write(('%s\n'%name).encode()) else: - f.write('\n') - f.write('\n') + f.write('\n'.encode()) + f.write('\n'.encode()) enums = [ (j, enums[j]) for j in extension[0] ] for e in sorted(enums, key=lambda i: i[1]): - f.write('\t%s %s\n'%(e[0], e[1])) + f.write(('\t%s %s\n'%(e[0], e[1])).encode()) commands = [ (j, commands[j]) for j in extension[1] ] for c in sorted(commands): params = ', '.join( [ '%s %s'%(j[0].strip(), j[1].strip()) for j in c[1][1] ] ) if len(params)==0: params = 'void' - f.write('\t%s %s (%s)\n'%(c[1][0].strip(), c[0].strip(), params)) + f.write(('\t%s %s (%s)\n'%(c[1][0].strip(), c[0].strip(), params)).encode()) if __name__ == '__main__':