From 567b51cad45109c55455fb19fe12a5a553e232c8 Mon Sep 17 00:00:00 2001 From: zhang-liang-pengkun Date: Thu, 19 Oct 2023 17:25:19 +0800 Subject: [PATCH] fix repr(Error): PID was not shown if PID == 0 Signed-off-by: zhang-liang-pengkun (cherry picked from commit e91c59d7faa590573b0ec0648340d8a6c1a95c89) (cherry picked from commit 60d09981220e318efe7ea1a0ca0318087b913bac) --- ...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 529ded9..545e856 100644 --- a/python-psutil.spec +++ b/python-psutil.spec @@ -1,10 +1,11 @@ Name: python-psutil Version: 5.9.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.9.0-2 +- fix repr(Error): PID was not shown if PID == 0 + * Mon Jun 13 2022 OpenStack_SIG - 5.9.0-1 - Update version to 5.9.0 -- Gitee