Closed adeepkit01 closed 4 years ago
I have been working on shifting the ns-3 project completely to python 3 which uses this project to generate python bindings.
We have been failing in operation due to an exception here:
def __lt__(self, other): if not isinstance(other, self.__class__): return self.__class__.__name__ < other.__class__.__name__ return self.name < other.name \ and self.default_value < other.default_value \ and self.decl_type < other.decl_type
Since None is a supported value for default_value but python 3 does not support None comparison, an exception is thrown in the above line.
I have been able to successfully workaround the issue with the following patch
diff --git a/pygccxml/declarations/calldef.py b/pygccxml/declarations/calldef.py index fd1fe17..7ed66bd 100644 --- a/pygccxml/declarations/calldef.py +++ b/pygccxml/declarations/calldef.py @@ -90,6 +90,11 @@ class argument_t(object): def __lt__(self, other): if not isinstance(other, self.__class__): return self.__class__.__name__ < other.__class__.__name__ + if other.default_value == None: + return False + if self.default_value == None: + return self.name < other.name \ + and self.decl_type < other.decl_type return self.name < other.name \ and self.default_value < other.default_value \ and self.decl_type < other.decl_type
This gives me the same behaviour as python 2.
Please suggest how this can be fixed in the mainline repo.
This was fixed by #107 on the develop branch and will be added to the 2.0 release.
I have been working on shifting the ns-3 project completely to python 3 which uses this project to generate python bindings.
We have been failing in operation due to an exception here:
Since None is a supported value for default_value but python 3 does not support None comparison, an exception is thrown in the above line.
I have been able to successfully workaround the issue with the following patch
This gives me the same behaviour as python 2.
Please suggest how this can be fixed in the mainline repo.