diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2019-06-14 16:11:14 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-14 16:11:14 +0800 |
commit | 5f4287d17fc6aa2643c4c6e3589c12abd0f1ded9 (patch) | |
tree | e2647abe030f560e3df048274697d1b5b45caae1 /psutil/_psosx.py | |
parent | 412cb7f845462b0a67b1d2ce9b3aa61c555aa262 (diff) | |
download | psutil-5f4287d17fc6aa2643c4c6e3589c12abd0f1ded9.tar.gz |
Connection family/type are not converted to enums (#1535)
Diffstat (limited to 'psutil/_psosx.py')
-rw-r--r-- | psutil/_psosx.py | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/psutil/_psosx.py b/psutil/_psosx.py index 7459a0f3..54e57202 100644 --- a/psutil/_psosx.py +++ b/psutil/_psosx.py @@ -8,20 +8,17 @@ import contextlib import errno import functools import os -from socket import AF_INET from collections import namedtuple from . import _common from . import _psposix from . import _psutil_osx as cext from . import _psutil_posix as cext_posix -from ._common import AF_INET6 from ._common import conn_tmap +from ._common import conn_to_ntuple from ._common import isfile_strict from ._common import memoize_when_activated from ._common import parse_environ_block -from ._common import sockfam_to_enum -from ._common import socktype_to_enum from ._common import usage_percent @@ -529,15 +526,8 @@ class Process(object): ret = [] for item in rawlist: fd, fam, type, laddr, raddr, status = item - status = TCP_STATUSES[status] - fam = sockfam_to_enum(fam) - type = socktype_to_enum(type) - if fam in (AF_INET, AF_INET6): - if laddr: - laddr = _common.addr(*laddr) - if raddr: - raddr = _common.addr(*raddr) - nt = _common.pconn(fd, fam, type, laddr, raddr, status) + nt = conn_to_ntuple(fd, fam, type, laddr, raddr, status, + TCP_STATUSES) ret.append(nt) return ret |