diff options
| author | William S Fulton <wsf@fultondesigns.co.uk> | 2014-10-07 20:13:32 +0100 |
|---|---|---|
| committer | William S Fulton <wsf@fultondesigns.co.uk> | 2014-10-07 20:58:41 +0100 |
| commit | 808d4b4798685dbbc8515277faa573c7ce40fbc2 (patch) | |
| tree | 20c6837aa5a1df76891d0e4fb3c9fdf0a0decc78 /Examples/python/exceptproxy | |
| parent | da394fae800ce121fb51d9c0ef2880fdce2f1b63 (diff) | |
| download | swig-808d4b4798685dbbc8515277faa573c7ce40fbc2.tar.gz | |
Bypass Python exmples not supported by -builtin
Builtin classes as exceptions not supported, so don't run these aspects
of the examples when using -builtin.
Diffstat (limited to 'Examples/python/exceptproxy')
| -rw-r--r-- | Examples/python/exceptproxy/example.i | 10 | ||||
| -rw-r--r-- | Examples/python/exceptproxy/runme.py | 6 |
2 files changed, 14 insertions, 2 deletions
diff --git a/Examples/python/exceptproxy/example.i b/Examples/python/exceptproxy/example.i index 4a1e0bae9..0a46afbb6 100644 --- a/Examples/python/exceptproxy/example.i +++ b/Examples/python/exceptproxy/example.i @@ -109,6 +109,12 @@ %template(doubleQueue) Queue<double>; - - +%inline %{ +// The -builtin SWIG option results in SWIGPYTHON_BUILTIN being defined +#ifdef SWIGPYTHON_BUILTIN +bool is_python_builtin() { return true; } +#else +bool is_python_builtin() { return false; } +#endif +%} diff --git a/Examples/python/exceptproxy/runme.py b/Examples/python/exceptproxy/runme.py index a2ae55584..07e4b0a7f 100644 --- a/Examples/python/exceptproxy/runme.py +++ b/Examples/python/exceptproxy/runme.py @@ -1,10 +1,16 @@ # file: runme.py import example +if example.is_python_builtin(): + print "Skipping example: -builtin option does not support %exceptionclass" + exit(0) + q = example.intQueue(10) print "Inserting items into intQueue" +print type(example.FullError) + try: for i in range(0,100): q.enqueue(i) |
