Fixed python3 bindings generation.
diff --git a/bindings/doxy2swig.py b/bindings/doxy2swig.py
index c6c972c..cf4c52b 100644
--- a/bindings/doxy2swig.py
+++ b/bindings/doxy2swig.py
@@ -33,7 +33,6 @@
import re
import textwrap
import sys
-import types
import os.path
import optparse
@@ -150,7 +149,7 @@
def add_text(self, value):
"""Adds text corresponding to `value` into `self.pieces`."""
- if type(value) in (types.ListType, types.TupleType):
+ if isinstance(value, (list, tuple)):
self.pieces.extend(value)
else:
self.pieces.append(value)
@@ -210,7 +209,7 @@
kind = node.attributes['kind'].value
if kind in ('class', 'struct'):
prot = node.attributes['prot'].value
- if prot <> 'public':
+ if prot != 'public':
return
names = ('compoundname', 'briefdescription',
'detaileddescription', 'includes')
@@ -281,7 +280,7 @@
if name[:8] == 'operator': # Don't handle operators yet.
return
- if not first.has_key('definition') or \
+ if not 'definition' in first or \
kind in ['variable', 'typedef']:
return
@@ -373,7 +372,7 @@
if not os.path.exists(fname):
fname = os.path.join(self.my_dir, fname)
if not self.quiet:
- print "parsing file: %s"%fname
+ print( "parsing file: %s"%fname )
p = Doxy2SWIG(fname, self.include_function_definition, self.quiet)
p.generate()
self.pieces.extend(self.clean_pieces(p.pieces))