From 0130de40cd60776531429f1b51f85c8ca9373f34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Thu, 7 Sep 2017 14:45:47 +0200 Subject: [PATCH] Makes the CSharp wrapper generator to work with Python 3 --- wrappers/csharp/genwrapper.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/wrappers/csharp/genwrapper.py b/wrappers/csharp/genwrapper.py index 2bf303cf6..e5aad72a7 100644 --- a/wrappers/csharp/genwrapper.py +++ b/wrappers/csharp/genwrapper.py @@ -22,7 +22,7 @@ import sys import pystache sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', 'tools')) -print sys.path +print(sys.path) import genapixml as CApi import abstractapi as AbsApi import metadoc @@ -604,17 +604,18 @@ def main(): interfaces = [] classes = [] - for _class in parser.classesIndex.values() + parser.interfacesIndex.values(): - if _class is not None: - try: - if type(_class) is AbsApi.Class: - impl = ClassImpl(_class, translator) - classes.append(impl) - else: - impl = InterfaceImpl(_class, translator) - interfaces.append(impl) - except AbsApi.Error as e: - print('Could not translate {0}: {1}'.format(_class.name.to_camel_case(fullName=True), e.args[0])) + for index in [parser.classesIndex, parser.interfacesIndex]: + for _class in index.values(): + if _class is not None: + try: + if type(_class) is AbsApi.Class: + impl = ClassImpl(_class, translator) + classes.append(impl) + else: + impl = InterfaceImpl(_class, translator) + interfaces.append(impl) + except AbsApi.Error as e: + print('Could not translate {0}: {1}'.format(_class.name.to_camel_case(fullName=True), e.args[0])) wrapper = WrapperImpl(enums, interfaces, classes) render(renderer, wrapper, args.outputdir + "/" + args.outputfile)