win32api.Apply
object = Apply(exceptionHandler, func , args )
Calls a Python function, but traps Win32 exceptions.
Parameters
Comments
Calls the specified function in a manner similar to the built-in function apply(), but allows Win32 exceptions to be handled by Python. If a Win32 exception occurs calling the function, the specified exceptionHandler is called, and its return value determines the action taken.
Return value | Description |
Tuple of (exc_type, exc_value) | This exception is raised to the Python caller of Apply() - This is conceptually similar to "raise exc_type, exc_value", although exception handlers must not themselves raise exceptions (see below). |
Integer | Must be one of the win32 exception constants, and this value is returned to Win32. See the Win32 documentation for details. |
None | The exception is considered not handled (ie, it is as if no exception handler exists). If a Python exception occurs in the Win32 exception handler, it is as if None were returned (ie, no tracebacks or other diagnostics are printed) |