From 808d4b4798685dbbc8515277faa573c7ce40fbc2 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Tue, 7 Oct 2014 20:13:32 +0100 Subject: 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. --- Examples/python/exceptproxy/example.i | 10 ++++++++-- Examples/python/exceptproxy/runme.py | 6 ++++++ 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'Examples/python/exceptproxy') 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; - - +%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) -- cgit v1.2.1