Skip to content

Commit

Permalink
more renames (linux)
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Apr 17, 2024
1 parent 2f4ad14 commit c625ef9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions psutil/_pslinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ class _Ipv6UnsupportedError(Exception):
pass


class Connections:
class NetConnections:
"""A wrapper on top of /proc/net/* files, retrieving per-process
and system-wide open connections (TCP, UDP, UNIX) similarly to
"netstat -an".
Expand Down Expand Up @@ -981,8 +981,8 @@ def process_inet(file, family, type_, inodes, filter_pid=None):
else:
status = _common.CONN_NONE
try:
laddr = Connections.decode_address(laddr, family)
raddr = Connections.decode_address(raddr, family)
laddr = NetConnections.decode_address(laddr, family)
raddr = NetConnections.decode_address(raddr, family)
except _Ipv6UnsupportedError:
continue
yield (fd, family, type_, laddr, raddr, status, pid)
Expand Down Expand Up @@ -1059,12 +1059,12 @@ def retrieve(self, kind, pid=None):
return list(ret)


_connections = Connections()
_net_connections = NetConnections()


def net_connections(kind='inet'):
"""Return system-wide open connections."""
return _connections.retrieve(kind)
return _net_connections.retrieve(kind)


def net_io_counters():
Expand Down Expand Up @@ -2345,7 +2345,7 @@ def open_files(self):

@wrap_exceptions
def net_connections(self, kind='inet'):
ret = _connections.retrieve(kind, self.pid)
ret = _net_connections.retrieve(kind, self.pid)
self._raise_if_not_alive()
return ret

Expand Down

0 comments on commit c625ef9

Please sign in to comment.