Skip to content

Commit

Permalink
Fix the linting errors
Browse files Browse the repository at this point in the history
Signed-off-by: Aurélien Bompard <[email protected]>
  • Loading branch information
abompard committed Aug 19, 2024
1 parent 756989e commit 35523b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions mirrormanager2/crawler/continents.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import collections
import csv
import functools
import logging
Expand Down Expand Up @@ -81,14 +82,14 @@ def check_continent(config, options, session, categoryUrl):

try:
addrinfo = socket.getaddrinfo(hostname, None)
except socket.gaierror:
except socket.gaierror as e:
# Name resolution failed. This means
# that the base URL is broken.
raise BrokenBaseUrl() from e

# Extract the IPv4 and IPv6 address from the tuples returned by getaddrinfo.
addresses = set()
for family, socktype, proto, canonname, sockaddr in addrinfo:
for family, _socktype, _proto, _canonname, sockaddr in addrinfo:
# The GeoIP2 databases contain only information for IPv4 and IPv6
# addresses. Therefore, other, unusual address families are ignored.
if family == socket.AF_INET:
Expand Down
5 changes: 3 additions & 2 deletions mirrormanager2/utility/generate_worldmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# while the rest of MirrorManager is licensed MIT/X11


import collections
import os
import socket
from urllib.parse import urlsplit
Expand Down Expand Up @@ -39,11 +40,11 @@ def main(config, verbose):
continue
gir = None
try:
addrinfo = socket.getaddrinfo(hn, None)
addrinfo = socket.getaddrinfo(hostname, None)
# Extract the IPv4 and IPv6 address from the tuples returned by
# getaddrinfo.
addresses = set()
for family, socktype, proto, canonname, sockaddr in addrinfo:
for family, _socktype, _proto, _canonname, sockaddr in addrinfo:
# The GeoIP2 databases contain only information for IPv4 and
# IPv6 addresses. Therefore, other, unusual address families
# are ignored.
Expand Down

0 comments on commit 35523b9

Please sign in to comment.