summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Beer <dbeer1@bloomberg.net>2019-04-02 10:28:49 -0400
committerGiampaolo Rodola <g.rodola@gmail.com>2019-04-02 16:28:49 +0200
commite91c041d84aa34790ebd6396dcbbc2e3391b0a73 (patch)
tree1a06272b4dbbc6f38415f8f8ac4894b6c7004df4
parent9691d791d7a00c7e4055156545941f4ccfa2ee12 (diff)
downloadpsutil-e91c041d84aa34790ebd6396dcbbc2e3391b0a73.tar.gz
Fix spurious exception when iterating processes on Solaris (#1471)
-rw-r--r--psutil/_psutil_sunos.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/psutil/_psutil_sunos.c b/psutil/_psutil_sunos.c
index 99423f7a..49100ec6 100644
--- a/psutil/_psutil_sunos.c
+++ b/psutil/_psutil_sunos.c
@@ -218,8 +218,10 @@ psutil_proc_name_and_args(PyObject *self, PyObject *args) {
/* If we can't read process memory or can't decode the result
* then return args from /proc. */
- if (!py_args)
+ if (!py_args) {
+ PyErr_Clear();
py_args = PyUnicode_DecodeFSDefault(info.pr_psargs);
+ }
/* Both methods has been failed. */
if (!py_args)