Skip to content

Commit

Permalink
#2238: passed wrong value to Py_BuildValue
Browse files Browse the repository at this point in the history
Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
  • Loading branch information
giampaolo committed Apr 16, 2023
1 parent 0e3f6c4 commit 0a81fa0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion psutil/arch/netbsd/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ psutil_proc_cwd(PyObject *self, PyObject *args) {
if (len == -1) {
if (errno == ENOENT) {
psutil_debug("sysctl(KERN_PROC_CWD) -> ENOENT converted to ''");
return Py_BuildValue("", "");
return Py_BuildValue("s", "");
}
else {
PyErr_SetFromErrno(PyExc_OSError);
Expand Down
2 changes: 1 addition & 1 deletion psutil/arch/openbsd/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ psutil_proc_cwd(PyObject *self, PyObject *args) {
if (sysctl(name, 3, path, &pathlen, NULL, 0) != 0) {
if (errno == ENOENT) {
psutil_debug("sysctl(KERN_PROC_CWD) -> ENOENT converted to ''");
return Py_BuildValue("", "");
return Py_BuildValue("s", "");
}
else {
PyErr_SetFromErrno(PyExc_OSError);
Expand Down

0 comments on commit 0a81fa0

Please sign in to comment.