- recover the proper catching exception mechanism for classes
(throw typemap). - fix the examples with exception problems and warnings - proper and consist treatment of basic types (short, unsigned char,...) now all are checked for range and sign. Before, this was depending of the use of parsing or no parsing, and/or the converter method, and/or the use of directors, etc. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5659 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
5078783796
commit
54737ee9a9
8 changed files with 459 additions and 243 deletions
|
|
@ -1,6 +1,10 @@
|
|||
/* File : example.h */
|
||||
|
||||
#include <string>
|
||||
#ifndef SWIG
|
||||
struct A {
|
||||
};
|
||||
#endif
|
||||
|
||||
class Exc {
|
||||
public:
|
||||
|
|
@ -22,6 +26,9 @@ public:
|
|||
}
|
||||
int hosed() throw(Exc) {
|
||||
throw(Exc(42,"Hosed"));
|
||||
}
|
||||
int unknown() throw(A) {
|
||||
throw A();
|
||||
}
|
||||
int multi(int x) throw(int, const char *, Exc) {
|
||||
if (x == 1) throw(37);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,11 @@
|
|||
import example
|
||||
|
||||
t = example.Test()
|
||||
try:
|
||||
t.unknown()
|
||||
except RuntimeError,e:
|
||||
print "incomplete type", e.args[0]
|
||||
|
||||
try:
|
||||
t.simple()
|
||||
except RuntimeError,e:
|
||||
|
|
@ -27,3 +32,5 @@ for i in range(1,4):
|
|||
print e.args[0]
|
||||
except example.Exc,e:
|
||||
print e.code, e.msg
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue