diff options
| author | Giampaolo Rodola <g.rodola@gmail.com> | 2016-10-07 22:07:18 +0200 |
|---|---|---|
| committer | Giampaolo Rodola <g.rodola@gmail.com> | 2016-10-07 22:07:18 +0200 |
| commit | 1e8cef9f124c881699853c26e79cd1e8a36bd03b (patch) | |
| tree | b3a6527b30f0ee77b90cd62812527ce4a313b9ca /psutil/_psosx.py | |
| parent | cf21849a24a62ebecac13ba377bb90b243e06e0b (diff) | |
| download | psutil-1e8cef9f124c881699853c26e79cd1e8a36bd03b.tar.gz | |
#799 / OSX: also include proc.name() in the list of grouped oneshot info
Diffstat (limited to 'psutil/_psosx.py')
| -rw-r--r-- | psutil/_psosx.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/psutil/_psosx.py b/psutil/_psosx.py index 284fed08..361c0a8b 100644 --- a/psutil/_psosx.py +++ b/psutil/_psosx.py @@ -68,6 +68,7 @@ kinfo_proc_map = dict( ttynr=7, ctime=8, status=9, + name=10, ) pidtaskinfo_map = dict( @@ -313,7 +314,8 @@ class Process(object): @wrap_exceptions def name(self): - return cext.proc_name(self.pid) + name = self._get_kinfo_proc()[kinfo_proc_map['name']] + return name if name is not None else cext.proc_name(self.pid) @wrap_exceptions def exe(self): |
