Skip to content

Return sorted pids() #1437

@giampaolo

Description

@giampaolo

...for consistency across different platforms. E.g., on OSX, pids are reverse sorted:

>>> import psutil
>>> psutil.pids()
[5944, 4135, 4134, 4029, 3004, 2890, 2889, 2887, 2875, 785, 593, 585, 
584, 576, 574, 573, 572, 533, 531, 530, 517, 509, 489, 488, 487, 486, 316, 
315, 271, 266, 263, 260, 259, 257, 255, 254, 249, 247, 244, 243,  235, 
233, 217, 191, 187, 186, 185, 183, 181, 180, 179, 177, 174, 173, 172, 169, 
167, 165, 164, 157, 151,  150, 149, 148, 139, 132, 129, 116, 115,  113, 112, 
108, 98, 97, 96, 94, 93, 92, 91, 89, 85, 84, 81, 79, 78,  77, 76, 74, 73, 71, 
70, 68,  67, 66, 62, 61, 59, 53, 52, 51, 47, 46, 44, 43, 1, 0]

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions