Skip to content

Commit 983d6c0

Browse files
committed
fix Python 3.13-related issues
1 parent e711c8f commit 983d6c0

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/nb_func.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,12 +1130,10 @@ static uint32_t nb_func_render_signature(const func_data *f,
11301130

11311131
static PyObject *nb_func_get_name(PyObject *self) {
11321132
func_data *f = nb_func_data(self);
1133-
if (f->flags & (uint32_t) func_flags::has_name) {
1134-
return PyUnicode_FromString(f->name);
1135-
} else {
1136-
Py_INCREF(Py_None);
1137-
return Py_None;
1138-
}
1133+
const char *name = "";
1134+
if (f->flags & (uint32_t) func_flags::has_name)
1135+
name = f->name;
1136+
return PyUnicode_FromString(name);
11391137
}
11401138

11411139
static PyObject *nb_func_get_qualname(PyObject *self) {

src/stubgen.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ class and repeatedly call ``.put()`` to register modules or contents within the
8989
"__doc__", "__module__", "__name__", "__new__", "__builtins__",
9090
"__cached__", "__path__", "__version__", "__spec__", "__loader__",
9191
"__package__", "__nb_signature__", "__class_getitem__", "__orig_bases__",
92-
"__file__", "__dict__", "__weakref__", "__format__", "__nb_enum__"
92+
"__file__", "__dict__", "__weakref__", "__format__", "__nb_enum__",
93+
"__firstlineno__", "__static_attributes__"
9394
]
9495
# fmt: on
9596

0 commit comments

Comments
 (0)