diff --git a/Doc/Manual/Customization.html b/Doc/Manual/Customization.html index e4c3e7950..5d886be4d 100644 --- a/Doc/Manual/Customization.html +++ b/Doc/Manual/Customization.html @@ -14,7 +14,6 @@
- -
-
%typemap(except) void *malloc {
- $action
- if (!$1) {
- PyExc_SetString(PyExc_MemoryError,"Out of memory in $symname");
- return NULL;
- }
-}
-
-void *malloc(int size);
-
-
-
-When applied, this automatically checks the return value of
-malloc() and raises an exception if it's invalid. For example
-:- -
-
- -When "except" typemaps are used, they override any exception handler defined with -%exception.->>> from example import * ->>> a = malloc(2048) ->>> b = malloc(1500000000) -Traceback (innermost last): - File "<stdin>", line 1, in ? -MemoryError: Out of memory in malloc ->>> -
- -
-Compatibility note: The except typemap dates to earlier SWIG -releases and was intended to be a mechanism for pinpointing specific +Compatibility note: The %exception directive replaces +the functionality provided by the deprecated "except" typemap. +The typemap would allow exceptions to be thrown in the target +language based on the return type of a function and +was intended to be a mechanism for pinpointing specific declarations. However, it never really worked that well and the new -%exception directive is much better. The except typemap is preserved for now, but -may be deprecated in future versions. +%exception directive is much better.