Skip to content

Commit

Permalink
fix Python 3.13-related issues
Browse files Browse the repository at this point in the history
  • Loading branch information
wjakob committed May 22, 2024
1 parent e711c8f commit 983d6c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 4 additions & 6 deletions src/nb_func.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1130,12 +1130,10 @@ static uint32_t nb_func_render_signature(const func_data *f,

static PyObject *nb_func_get_name(PyObject *self) {
func_data *f = nb_func_data(self);
if (f->flags & (uint32_t) func_flags::has_name) {
return PyUnicode_FromString(f->name);
} else {
Py_INCREF(Py_None);
return Py_None;
}
const char *name = "";
if (f->flags & (uint32_t) func_flags::has_name)
name = f->name;
return PyUnicode_FromString(name);
}

static PyObject *nb_func_get_qualname(PyObject *self) {
Expand Down
3 changes: 2 additions & 1 deletion src/stubgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ class and repeatedly call ``.put()`` to register modules or contents within the
"__doc__", "__module__", "__name__", "__new__", "__builtins__",
"__cached__", "__path__", "__version__", "__spec__", "__loader__",
"__package__", "__nb_signature__", "__class_getitem__", "__orig_bases__",
"__file__", "__dict__", "__weakref__", "__format__", "__nb_enum__"
"__file__", "__dict__", "__weakref__", "__format__", "__nb_enum__",
"__firstlineno__", "__static_attributes__"
]
# fmt: on

Expand Down

0 comments on commit 983d6c0

Please sign in to comment.