summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2020-02-18 02:39:13 +0100
committerGiampaolo Rodola <g.rodola@gmail.com>2020-02-18 02:39:13 +0100
commit41fcba5dd7ecbbc788814c722f31e630422ba28e (patch)
tree76429d282c2df833169818960b8b3fe7237ad062
parentc9fc4fdadc5a19d97916cbf13b1b479834b94bd8 (diff)
downloadpsutil-41fcba5dd7ecbbc788814c722f31e630422ba28e.tar.gz
revert process_iter() exactly how it was pre #1667
-rw-r--r--docs/DEVNOTES5
-rw-r--r--psutil/__init__.py5
2 files changed, 5 insertions, 5 deletions
diff --git a/docs/DEVNOTES b/docs/DEVNOTES
index abd2e368..7fe14f7d 100644
--- a/docs/DEVNOTES
+++ b/docs/DEVNOTES
@@ -158,10 +158,11 @@ BUGFIXES
- #600: windows / open_files(): support network file handles.
-REJECTED
-========
+REJECTED IDEAS
+==============
- #550: threads per core
+- #1667: process_iter(new_only=True)
INCONSISTENCIES
===============
diff --git a/psutil/__init__.py b/psutil/__init__.py
index 2f4e147f..22bb46f3 100644
--- a/psutil/__init__.py
+++ b/psutil/__init__.py
@@ -1427,7 +1427,6 @@ def process_iter(attrs=None, ad_value=None):
to returned Process instance.
If *attrs* is an empty list it will retrieve all process info
(slow).
-
"""
def add(pid):
proc = Process(pid)
@@ -1449,8 +1448,8 @@ def process_iter(attrs=None, ad_value=None):
remove(pid)
with _lock:
- ls = list(dict.fromkeys(new_pids).items())
- ls.sort()
+ ls = sorted(list(_pmap.items()) +
+ list(dict.fromkeys(new_pids).items()))
for pid, proc in ls:
try: