From a933e458b302208f1d08b6481ef36bce3e166e0c Mon Sep 17 00:00:00 2001 From: Bruno da Silva de Oliveira Date: Sat, 16 Aug 2003 19:13:45 +0000 Subject: [PATCH] - Fixed a bug in the pure virtual functions [SVN r19648] --- pyste/NEWS | 3 +++ pyste/TODO | 2 +- pyste/src/Pyste/ClassExporter.py | 9 +++++---- pyste/src/Pyste/pyste.py | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/pyste/NEWS b/pyste/NEWS index b277cfd3..936e2e03 100644 --- a/pyste/NEWS +++ b/pyste/NEWS @@ -2,6 +2,9 @@ Applied a patch by Gottfried Ganssauge that adds exception specifiers to wrapper functions and pointer declarations. Thanks a lot Gottfried!! +Applied a patch by Prabhu Ramachandran that fixes ae problem with the +pure virtual method generation. Thanks again Prabhu! + 10 August 2003 Support for incremental generation of the code has been added. This changes how --multiple works; documentation of this new feature will follow. Thanks diff --git a/pyste/TODO b/pyste/TODO index 75ae99bd..778ec11e 100644 --- a/pyste/TODO +++ b/pyste/TODO @@ -9,4 +9,4 @@ - Virtual operators -- Apply Gottfried patches +- args() support diff --git a/pyste/src/Pyste/ClassExporter.py b/pyste/src/Pyste/ClassExporter.py index a1fcb552..a75ff0bb 100644 --- a/pyste/src/Pyste/ClassExporter.py +++ b/pyste/src/Pyste/ClassExporter.py @@ -713,12 +713,13 @@ class _VirtualWrapperGenerator(object): if method.abstract: s = indent2 + 'PyErr_SetString(PyExc_RuntimeError, "pure virtual function called");\n' +\ indent2 + 'throw_error_already_set();\n' - if method.result.FullName() != 'void': - s += indent2 + 'return %s();\n' % method.result.FullName() + params = ', '.join(param_names) + s += indent2 + '%s%s(%s);\n' % \ + (return_str, method.name, params) return s - else: + else: return indent2 + '%s%s(%s);\n' % \ - (return_str, method.FullName(), ', '.join(param_names)) + (return_str, method.FullName(), ', '.join(param_names)) else: # return a call for the wrapper params = ', '.join(['this'] + param_names) diff --git a/pyste/src/Pyste/pyste.py b/pyste/src/Pyste/pyste.py index a11f97b2..b3d49958 100644 --- a/pyste/src/Pyste/pyste.py +++ b/pyste/src/Pyste/pyste.py @@ -43,7 +43,7 @@ from CppParser import CppParser, CppParserError import time from declarations import Typedef -__VERSION__ = '0.9.13' +__VERSION__ = '0.9.14' def RecursiveIncludes(include): 'Return a list containg the include dir and all its subdirectories'