From e9b3ac436a9a3f270cd919a8d8a31d35aef93a22 Mon Sep 17 00:00:00 2001 From: zhang-liang-pengkun Date: Thu, 19 Oct 2023 17:12:32 +0800 Subject: [PATCH] fix repr(Error): PID was not shown if PID == 0 Signed-off-by: zhang-liang-pengkun --- ...epr-Error-PID-was-not-shown-if-PID-0.patch | 26 +++++++++++++++++++ python-psutil.spec | 6 ++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 0001-fix-repr-Error-PID-was-not-shown-if-PID-0.patch diff --git a/0001-fix-repr-Error-PID-was-not-shown-if-PID-0.patch b/0001-fix-repr-Error-PID-was-not-shown-if-PID-0.patch new file mode 100644 index 0000000..f858b2d --- /dev/null +++ b/0001-fix-repr-Error-PID-was-not-shown-if-PID-0.patch @@ -0,0 +1,26 @@ +From d135e2c3a99bfd1bd01d1158ec31dbc8dc1c910f Mon Sep 17 00:00:00 2001 +From: Giampaolo Rodola +Date: Sat, 15 Jan 2022 22:21:39 +0100 +Subject: [PATCH] fix repr(Error): PID was not shown if PID == 0 + +Signed-off-by: Giampaolo Rodola +--- + psutil/_common.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/psutil/_common.py b/psutil/_common.py +index 1e33699c..c94a8378 100644 +--- a/psutil/_common.py ++++ b/psutil/_common.py +@@ -289,7 +289,7 @@ class Error(Exception): + info = {} # Python 2.6 + for name in attrs: + value = getattr(self, name, None) +- if value: ++ if value is not None: + info[name] = value + return info + +-- +2.39.0.windows.2 + diff --git a/python-psutil.spec b/python-psutil.spec index 6a6ee45..6579472 100644 --- a/python-psutil.spec +++ b/python-psutil.spec @@ -1,10 +1,11 @@ Name: python-psutil Version: 5.8.0 -Release: 1 +Release: 2 Summary: A library for retrieving information on running processes and system utilization in Python License: BSD URL: https://github.com/giampaolo/psutil Source0: https://github.com/giampaolo/psutil/archive/release-%{version}.tar.gz#/psutil-%{version}.tar.gz +Patch0001: 0001-fix-repr-Error-PID-was-not-shown-if-PID-0.patch BuildRequires: gcc python3-devel procps-ng python3-mock @@ -48,6 +49,9 @@ done %{python3_sitearch}/*.egg-info %changelog +* Thu Oct 19 2023 zhangliangpengkun - 5.8.0-2 +- fix repr(Error): PID was not shown if PID == 0 + * Thu Jul 15 2021 OpenStack_SIG - 5.8.0-1 - Update version to 5.8.0 -- Gitee