Skip to content

Commit 9718ffe

Browse files
committed
Updated to support Python 3.10 (at least).
1 parent c27dc29 commit 9718ffe

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

vunit/vhdl/python/src/python_pkg.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ void check_conversion_error(const char* expr) {
4747

4848
void handle_type_check_error(PyObject* pyobj, const char* context,
4949
const char* expr) {
50-
PyObject* type_name = PyType_GetName(Py_TYPE(pyobj));
51-
if (type_name == NULL) {
50+
PyTypeObject* type = pyobj->ob_type;
51+
if (type == NULL) {
5252
py_error_handler(context, expr, "Expression evaluates to an unknown type.",
5353
true);
5454
}
55+
const char* type_name_str = type->tp_name;
56+
Py_DECREF(type);
5557

56-
const char* type_name_str = get_string(type_name);
57-
Py_DECREF(type_name);
5858
if (type_name_str == NULL) {
5959
py_error_handler(context, expr, "Expression evaluates to an unknown type.",
6060
true);

0 commit comments

Comments
 (0)