summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Rytarowski <krytarowski@users.noreply.github.com>2020-01-30 00:40:27 +0100
committerGitHub <noreply@github.com>2020-01-30 00:40:27 +0100
commitf4e337aa04dac93347118f488491941026ec7e4f (patch)
tree048fb3a9bb03bba019f833962d6fb2ac20d4265e
parent994c429c010049a6a0556ce3b0d1af1f86f27867 (diff)
downloadpsutil-f4e337aa04dac93347118f488491941026ec7e4f.tar.gz
Add special case for psutil_proc_cwd/NetBSD (#1538)
-rw-r--r--psutil/arch/netbsd/specific.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/psutil/arch/netbsd/specific.c b/psutil/arch/netbsd/specific.c
index 04eab439..9dab3618 100644
--- a/psutil/arch/netbsd/specific.c
+++ b/psutil/arch/netbsd/specific.c
@@ -125,7 +125,10 @@ psutil_proc_cwd(PyObject *self, PyObject *args) {
#ifdef KERN_PROC_CWD
int name[] = { CTL_KERN, KERN_PROC_ARGS, pid, KERN_PROC_CWD};
if (sysctl(name, 4, path, &pathlen, NULL, 0) != 0) {
- PyErr_SetFromErrno(PyExc_OSError);
+ if (errno == ENOENT)
+ NoSuchProcess("");
+ else
+ PyErr_SetFromErrno(PyExc_OSError);
return NULL;
}
#else