Skip to content

Commit e3ca809

Browse files
committed
Run black-reformat
1 parent 2f90eb7 commit e3ca809

9 files changed

Lines changed: 1254 additions & 945 deletions

File tree

src/hyperlink/_socket.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from socket import inet_pton
33
except ImportError:
44
from typing import TYPE_CHECKING
5+
56
if TYPE_CHECKING: # pragma: no cover
67
pass
78
else:
@@ -25,7 +26,7 @@ class SockAddr(ctypes.Structure):
2526
def inet_pton(address_family, ip_string):
2627
# type: (int, str) -> bytes
2728
addr = SockAddr()
28-
ip_string_bytes = ip_string.encode('ascii')
29+
ip_string_bytes = ip_string.encode("ascii")
2930
addr.sa_family = address_family
3031
addr_size = ctypes.c_int(ctypes.sizeof(addr))
3132

@@ -37,10 +38,16 @@ def inet_pton(address_family, ip_string):
3738
except KeyError:
3839
raise socket.error("unknown address family")
3940

40-
if WSAStringToAddressA(
41-
ip_string_bytes, address_family, None,
42-
ctypes.byref(addr), ctypes.byref(addr_size)
43-
) != 0:
41+
if (
42+
WSAStringToAddressA(
43+
ip_string_bytes,
44+
address_family,
45+
None,
46+
ctypes.byref(addr),
47+
ctypes.byref(addr_size),
48+
)
49+
!= 0
50+
):
4451
raise socket.error(ctypes.FormatError())
4552

4653
return ctypes.string_at(getattr(addr, attribute), size)

0 commit comments

Comments
 (0)