Skip to content

Commit

Permalink
filter connections
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Jan 6, 2024
1 parent 2f56ac1 commit 7f5f6fb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion psutil/tests/test_connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@


def this_proc_connections(kind):
# This process may use some UNIX sockets which are not initialized
# by us. Let's filter them.
cons = psutil.Process().connections(kind=kind)
if kind in ("all", "unix"):
new = []
for conn in cons:
if conn.family == socket.AF_UNIX:
if POSIX and conn.family == socket.AF_UNIX:
if MACOS and "/syslog" in conn.raddr:
debug("skipping %r" % conn)
continue
Expand Down

0 comments on commit 7f5f6fb

Please sign in to comment.