pids: case insensitive string comparison for process names (#52564)

This commit is contained in:
abyss 2019-03-14 18:27:20 +05:30 committed by Abhijeet Kasurde
parent b8da83cfe0
commit e428441a1d

View file

@ -53,7 +53,7 @@ except ImportError:
def get_pid(name):
return [p.info['pid'] for p in psutil.process_iter(attrs=['pid', 'name']) if name == p.info['name']]
return [p.info['pid'] for p in psutil.process_iter(attrs=['pid', 'name']) if p.info and p.info.get('name', None) and p.info['name'].lower() == name.lower()]
def main():