resonance 1.0.1
Loading...
Searching...
No Matches
typeerror.h
Go to the documentation of this file.
1#pragma once
2
3#include "os/hxstr.h"
4#include "script/cxx/config.h"
6
7namespace Py {
8
21class TypeError : public StandardError {
22public:
29 TypeError(const HxStr &reason) {
30 PyErr_SetString(PyExc_TypeError, reason.mStr != nullptr ? reason.mStr : g_szEmptyString);
31 }
32};
33
34} // namespace Py
Heap-allocated NUL-terminated string.
Definition hxstr.h:41
char * mStr
Text buffer.
Definition hxstr.h:464
Intermediate of the PyCXX exception hierarchy, mirroring Python's StandardError.
Definition standarderror.h:14
TypeError(const HxStr &reason)
Set the Python error indicator and become the thrown object.
Definition typeerror.h:29
Configuration header of the PyCXX binding layer.
const char * g_szEmptyString
Text an empty HxStr points at, and the substitute for a null buffer.
C++ wrappers for the embedded Python interpreter's objects, types, and extension modules.
Definition attributeerror.h:7