diff options
Diffstat (limited to 'Examples/python/exceptproxy')
-rw-r--r-- | Examples/python/exceptproxy/Makefile | 8 | ||||
-rw-r--r-- | Examples/python/exceptproxy/example.i | 10 | ||||
-rw-r--r-- | Examples/python/exceptproxy/runme.py | 6 |
3 files changed, 18 insertions, 6 deletions
diff --git a/Examples/python/exceptproxy/Makefile b/Examples/python/exceptproxy/Makefile index 86a643415..f406dfaf4 100644 --- a/Examples/python/exceptproxy/Makefile +++ b/Examples/python/exceptproxy/Makefile @@ -7,15 +7,15 @@ LIBS = -lm SWIGOPT = check: build - $(MAKE) -f $(TOP)/Makefile python_run + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' python_run build: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' python_cpp static: - $(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \ SWIGOPT='$(SWIGOPT)' TARGET='mypython' INTERFACE='$(INTERFACE)' python_cpp_static clean: - $(MAKE) -f $(TOP)/Makefile TARGET='$(TARGET)' python_clean + $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' python_clean 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) |