Skip to content

Commit

Permalink
typing: Type ignore socket.AF_UNIX
Browse files Browse the repository at this point in the history
This fixes typechecking on windows, as socket.AF_UNIX is not defined
there. Adding unused-ignore also fixes the unused ignore error on mac
and linux.
  • Loading branch information
Amund211 committed Jun 4, 2023
1 parent 9ab0cd5 commit 4e6e497
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion discordrp/presence.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def __init__(self) -> None:
# Try to connect to a socket, starting from 0 up to 9
for i in range(10):
try:
self._sock = socket.socket(socket.AF_UNIX)
self._sock = socket.socket(socket.AF_UNIX) # type: ignore [attr-defined,unused-ignore]
self._sock.connect(pipe.format(i))
break
except FileNotFoundError:
Expand Down

0 comments on commit 4e6e497

Please sign in to comment.