(def-err-symbol sym-name)
(PyErr_BadArgument)
This is a shorthand for PyErr_SetString(PyExc_TypeError, message), where message indicates that a built-in operation was invoked with an illegal argument. It is mostly for internal use.
This is a shorthand for PyErr_SetString(PyExc_TypeError, message), where message indicates that a built-in operation was invoked with an illegal argument. It is mostly for internal use.
(PyErr_BadInternalCall)
This is a shorthand for PyErr_SetString(PyExc_SystemError, message), where message indicates that an internal operation (e.g. a Python/C API function) was invoked with an illegal argument. It is mostly for internal use.
This is a shorthand for PyErr_SetString(PyExc_SystemError, message), where message indicates that an internal operation (e.g. a Python/C API function) was invoked with an illegal argument. It is mostly for internal use.
(PyErr_Clear)
Clear the error indicator. If the error indicator is not set, there is no effect.
Clear the error indicator. If the error indicator is not set, there is no effect.
(PyErr_Fetch ptype pvalue ptraceback)
Retrieve the error indicator into three variables whose addresses are passed. If the error indicator is not set, set all three variables to NULL. If it is set, it will be cleared and you own a reference to each object retrieved. The value and traceback object may be NULL even when the type object is not.
Note
This function is normally only used by code that needs to catch exceptions or by code that needs to save and restore the error indicator temporarily, e.g.:
{ PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback);
/* ... code that might produce other errors ... */
PyErr_Restore(type, value, traceback);
}
Retrieve the error indicator into three variables whose addresses are passed. If the error indicator is not set, set all three variables to NULL. If it is set, it will be cleared and you own a reference to each object retrieved. The value and traceback object may be NULL even when the type object is not. Note This function is normally only used by code that needs to catch exceptions or by code that needs to save and restore the error indicator temporarily, e.g.: { PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); /* ... code that might produce other errors ... */ PyErr_Restore(type, value, traceback); }
(PyErr_NoMemory)
Return value: Always NULL.
This is a shorthand for PyErr_SetNone(PyExc_MemoryError); it returns NULL so an object allocation function can write return PyErr_NoMemory(); when it runs out of memory.
Return value: Always NULL. This is a shorthand for PyErr_SetNone(PyExc_MemoryError); it returns NULL so an object allocation function can write return PyErr_NoMemory(); when it runs out of memory.
(PyErr_Occurred)
Check if the error indicator is set. If so, return the exception type.
Check if the error indicator is set. If so, return the exception type.
(PyErr_PrintEx set-sys-last-vars)
Print a standard traceback to sys.stderr and clear the error indicator. Unless the error is a SystemExit. In that case the no traceback is printed and Python process will exit with the error code specified by the SystemExit instance.
Call this function only when the error indicator is set. Otherwise it will cause a fatal error!
If set_sys_last_vars is nonzero, the variables sys.last_type, sys.last_value and sys.last_traceback will be set to the type, value and traceback of the printed exception, respectively.
Print a standard traceback to sys.stderr and clear the error indicator. Unless the error is a SystemExit. In that case the no traceback is printed and Python process will exit with the error code specified by the SystemExit instance. Call this function only when the error indicator is set. Otherwise it will cause a fatal error! If set_sys_last_vars is nonzero, the variables sys.last_type, sys.last_value and sys.last_traceback will be set to the type, value and traceback of the printed exception, respectively.
(PyErr_Restore value traceback)
Set the error indicator from the three objects. If the error indicator is already set, it is cleared first. If the objects are NULL, the error indicator is cleared. Do not pass a NULL type and non-NULL value or traceback. The exception type should be a class. Do not pass an invalid exception type or value. (Violating these rules will cause subtle problems later.) This call takes away a reference to each object: you must own a reference to each object before the call and after the call you no longer own these references. (If you don’t understand this, don’t use this function. I warned you.)
Note
This function is normally only used by code that needs to save and restore the error indicator temporarily. Use PyErr_Fetch() to save the current error indicator.
Set the error indicator from the three objects. If the error indicator is already set, it is cleared first. If the objects are NULL, the error indicator is cleared. Do not pass a NULL type and non-NULL value or traceback. The exception type should be a class. Do not pass an invalid exception type or value. (Violating these rules will cause subtle problems later.) This call takes away a reference to each object: you must own a reference to each object before the call and after the call you no longer own these references. (If you don’t understand this, don’t use this function. I warned you.) Note This function is normally only used by code that needs to save and restore the error indicator temporarily. Use PyErr_Fetch() to save the current error indicator.
(PyErr_SetFromErrno type)
Return value: Always NULL.
This is a convenience function to raise an exception when a C library function has returned an error and set the C variable errno. It constructs a tuple object whose first item is the integer errno value and whose second item is the corresponding error message (gotten from strerror()), and then calls PyErr_SetObject(type, object). On Unix, when the errno value is EINTR, indicating an interrupted system call, this calls PyErr_CheckSignals(), and if that set the error indicator, leaves it set to that. The function always returns NULL, so a wrapper function around a system call can write return PyErr_SetFromErrno(type); when the system call returns an error.
Return value: Always NULL. This is a convenience function to raise an exception when a C library function has returned an error and set the C variable errno. It constructs a tuple object whose first item is the integer errno value and whose second item is the corresponding error message (gotten from strerror()), and then calls PyErr_SetObject(type, object). On Unix, when the errno value is EINTR, indicating an interrupted system call, this calls PyErr_CheckSignals(), and if that set the error indicator, leaves it set to that. The function always returns NULL, so a wrapper function around a system call can write return PyErr_SetFromErrno(type); when the system call returns an error.
(PyErr_SetNone type)
This is a shorthand for PyErr_SetObject(type, Py_None).
This is a shorthand for PyErr_SetObject(type, Py_None).
(PyErr_SetObject type value)
This function is similar to PyErr_SetString() but lets you specify an arbitrary Python object for the “value” of the exception.
This function is similar to PyErr_SetString() but lets you specify an arbitrary Python object for the “value” of the exception.
(PyErr_SetString type message)
This is the most common way to set the error indicator. The first argument specifies the exception type; it is normally one of the standard exceptions, e.g. PyExc_RuntimeError. You need not increment its reference count. The second argument is an error message; it is decoded from 'utf-8’.
This is the most common way to set the error indicator. The first argument specifies the exception type; it is normally one of the standard exceptions, e.g. PyExc_RuntimeError. You need not increment its reference count. The second argument is an error message; it is decoded from 'utf-8’.
(PyErr_WarnEx category message stack_level)
Issue a warning message. The category argument is a warning category (see below) or NULL; the message argument is a UTF-8 encoded string. stack_level is a positive number giving a number of stack frames; the warning will be issued from the currently executing line of code in that stack frame. A stack_level of 1 is the function calling PyErr_WarnEx(), 2 is the function above that, and so forth.
Warning categories must be subclasses of PyExc_Warning; PyExc_Warning is a subclass of PyExc_Exception; the default warning category is PyExc_RuntimeWarning. The standard Python warning categories are available as global variables whose names are enumerated at Standard Warning Categories.
For information about warning control, see the documentation for the warnings module and the -W option in the command line documentation. There is no C API for warning control.
Issue a warning message. The category argument is a warning category (see below) or NULL; the message argument is a UTF-8 encoded string. stack_level is a positive number giving a number of stack frames; the warning will be issued from the currently executing line of code in that stack frame. A stack_level of 1 is the function calling PyErr_WarnEx(), 2 is the function above that, and so forth. Warning categories must be subclasses of PyExc_Warning; PyExc_Warning is a subclass of PyExc_Exception; the default warning category is PyExc_RuntimeWarning. The standard Python warning categories are available as global variables whose names are enumerated at Standard Warning Categories. For information about warning control, see the documentation for the warnings module and the -W option in the command line documentation. There is no C API for warning control.
(PyErr_WarnExplicit category message filename lineno module registry)
Similar to PyErr_WarnExplicitObject() except that message and module are UTF-8 encoded strings, and filename is decoded from the filesystem encoding (os.fsdecode()).
Similar to PyErr_WarnExplicitObject() except that message and module are UTF-8 encoded strings, and filename is decoded from the filesystem encoding (os.fsdecode()).
(PyErr_WriteUnraisable obj)
This utility function prints a warning message to sys.stderr when an exception has been set but it is impossible for the interpreter to actually raise the exception. It is used, for example, when an exception occurs in an del() method.
The function is called with a single argument obj that identifies the context in which the unraisable exception occurred. If possible, the repr of obj will be printed in the warning message.
An exception must be set when calling this function.
This utility function prints a warning message to sys.stderr when an exception has been set but it is impossible for the interpreter to actually raise the exception. It is used, for example, when an exception occurs in an __del__() method. The function is called with a single argument obj that identifies the context in which the unraisable exception occurred. If possible, the repr of obj will be printed in the warning message. An exception must be set when calling this function.
(PyExc_ArithmeticError)
(PyExc_AssertionError)
(PyExc_AttributeError)
(PyExc_BaseException)
(PyExc_BlockingIOError)
(PyExc_BrokenPipeError)
(PyExc_BufferError)
(PyExc_BytesWarning)
(PyExc_ChildProcessError)
(PyExc_ConnectionAbortedError)
(PyExc_ConnectionError)
(PyExc_ConnectionRefusedError)
(PyExc_ConnectionResetError)
(PyExc_DeprecationWarning)
(PyExc_EOFError)
(PyExc_Exception)
(PyExc_FileExistsError)
(PyExc_FileNotFoundError)
(PyExc_FloatingPointError)
(PyExc_FutureWarning)
(PyExc_GeneratorExit)
(PyExc_ImportError)
(PyExc_ImportWarning)
(PyExc_IndentationError)
(PyExc_IndexError)
(PyExc_InterruptedError)
(PyExc_IsADirectoryError)
(PyExc_KeyboardInterrupt)
(PyExc_KeyError)
(PyExc_LookupError)
(PyExc_MemoryError)
(PyExc_ModuleNotFoundError)
(PyExc_NameError)
(PyExc_NotADirectoryError)
(PyExc_NotImplementedError)
(PyExc_OSError)
(PyExc_OverflowError)
(PyExc_PendingDeprecationWarning)
(PyExc_PermissionError)
(PyExc_ProcessLookupError)
(PyExc_RecursionError)
(PyExc_ReferenceError)
(PyExc_ResourceWarning)
(PyExc_RuntimeError)
(PyExc_RuntimeWarning)
(PyExc_StopAsyncIteration)
(PyExc_StopIteration)
(PyExc_SyntaxError)
(PyExc_SyntaxWarning)
(PyExc_SystemError)
(PyExc_SystemExit)
(PyExc_TabError)
(PyExc_TimeoutError)
(PyExc_TypeError)
(PyExc_UnboundLocalError)
(PyExc_UnicodeDecodeError)
(PyExc_UnicodeEncodeError)
(PyExc_UnicodeError)
(PyExc_UnicodeTranslateError)
(PyExc_UnicodeWarning)
(PyExc_UserWarning)
(PyExc_ValueError)
(PyExc_Warning)
(PyExc_ZeroDivisionError)
(PyException_GetCause ex)
Return value: New reference.
Return the cause (either an exception instance, or None, set by raise ... from ...) associated with the exception as a new reference, as accessible from Python through cause.
Return value: New reference. Return the cause (either an exception instance, or None, set by raise ... from ...) associated with the exception as a new reference, as accessible from Python through __cause__.
(PyException_GetContext ex)
Return value: New reference.
Return the context (another exception instance during whose handling ex was raised) associated with the exception as a new reference, as accessible from Python through context. If there is no context associated, this returns NULL.
Return value: New reference. Return the context (another exception instance during whose handling ex was raised) associated with the exception as a new reference, as accessible from Python through __context__. If there is no context associated, this returns NULL.
(PyException_GetTraceback ex)
Return value: New reference.
Return the traceback associated with the exception as a new reference, as accessible from Python through traceback. If there is no traceback associated, this returns NULL.
Return value: New reference. Return the traceback associated with the exception as a new reference, as accessible from Python through __traceback__. If there is no traceback associated, this returns NULL.
(PyException_SetCause ex cause)
Set the cause associated with the exception to cause. Use NULL to clear it. There is no type check to make sure that cause is either an exception instance or None. This steals a reference to cause.
suppress_context is implicitly set to True by this function.
Set the cause associated with the exception to cause. Use NULL to clear it. There is no type check to make sure that cause is either an exception instance or None. This steals a reference to cause. __suppress_context__ is implicitly set to True by this function.
(PyException_SetContext ex ctx)
Set the context associated with the exception to ctx. Use NULL to clear it. There is no type check to make sure that ctx is an exception instance. This steals a reference to ctx.
Set the context associated with the exception to ctx. Use NULL to clear it. There is no type check to make sure that ctx is an exception instance. This steals a reference to ctx.
(PyException_SetTraceback ex tb)
Set the traceback associated with the exception to tb. Use Py_None to clear it.
Set the traceback associated with the exception to tb. Use Py_None to clear it.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close