!33 [sync] PR-32: [sync] PR-30: fix repr(Error): PID was not shown if PID == 0

From: @openeuler-sync-bot 
Reviewed-by: @lyn1001 
Signed-off-by: @lyn1001
This commit is contained in:
openeuler-ci-bot 2023-11-28 11:16:03 +00:00 committed by Gitee
commit 201c2fc25d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 31 additions and 1 deletions

View File

@ -0,0 +1,26 @@
From d135e2c3a99bfd1bd01d1158ec31dbc8dc1c910f Mon Sep 17 00:00:00 2001
From: Giampaolo Rodola <g.rodola@gmail.com>
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 <g.rodola@gmail.com>
---
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

View File

@ -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<zhangliangpengkun@xfusion.com> - 5.9.0-2
- fix repr(Error): PID was not shown if PID == 0
* Mon Jun 13 2022 OpenStack_SIG <openstack@openeuler.org> - 5.9.0-1
- Update version to 5.9.0