Fix pylint errors (false positives)

The errors were

    ************* Module linkcheck.ansicolor
    linkcheck/ansicolor.py:190:21: E0606: Possibly using variable 'WinColor' before assignment (possibly-used-before-assignment)
    ************* Module linkcheck.plugins.locationinfo
    linkcheck/plugins/locationinfo.py:107:12: E0606: Possibly using variable 'geoip_error' before assignment (possibly-used-before-assignment)

and while it's true that the variables (WinColor, geoip_error) are
assigned conditionally, their use is protected (indirectly) by the same
conditionals.
This commit is contained in:
Marius Gedminas 2024-05-20 14:10:30 +03:00
parent 06d662a677
commit b5fa5054c9
2 changed files with 5 additions and 0 deletions

View file

@ -159,6 +159,10 @@ if os.name == 'nt':
Cyan: colorama.CYAN,
White: colorama.GREY,
}
else:
WinColor = {
None: None,
}
# pc speaker beep escape code
Beep = "\007"

View file

@ -69,6 +69,7 @@ def get_geoip_dat():
# try importing both the C-library GeoIP and the pure-python pygeoip
geoip_dat = get_geoip_dat()
geoip = None
geoip_error = None
if geoip_dat:
try:
import GeoIP