mirror of
https://git.linux-kernel.at/oliver/ivatar.git
synced 2025-11-15 20:48:02 +00:00
Fix more "invalid-name" pylint overrides
This commit is contained in:
@@ -24,21 +24,21 @@ def get_photo(email):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
urlopen(image_url, timeout=URL_TIMEOUT)
|
urlopen(image_url, timeout=URL_TIMEOUT)
|
||||||
except HTTPError as e: # pylint: disable=invalid-name
|
except HTTPError as exc:
|
||||||
if e.code != 404 and e.code != 503:
|
if exc.code != 404 and exc.code != 503:
|
||||||
print( # pragma: no cover
|
print( # pragma: no cover
|
||||||
'Gravatar fetch failed with an unexpected %s HTTP error' %
|
'Gravatar fetch failed with an unexpected %s HTTP error' %
|
||||||
e.code)
|
exc.code)
|
||||||
return False
|
return False
|
||||||
except URLError as e: # pragma: no cover # pylint: disable=invalid-name
|
except URLError as exc: # pragma: no cover
|
||||||
print(
|
print(
|
||||||
'Gravatar fetch failed with URL error: %s' %
|
'Gravatar fetch failed with URL error: %s' %
|
||||||
e.reason) # pragma: no cover
|
exc.reason) # pragma: no cover
|
||||||
return False # pragma: no cover
|
return False # pragma: no cover
|
||||||
except SSLError as e: # pragma: no cover # pylint: disable=invalid-name
|
except SSLError as exc: # pragma: no cover
|
||||||
print(
|
print(
|
||||||
'Gravatar fetch failed with SSL error: %s' %
|
'Gravatar fetch failed with SSL error: %s' %
|
||||||
e.reason) # pragma: no cover
|
exc.reason) # pragma: no cover
|
||||||
return False # pragma: no cover
|
return False # pragma: no cover
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -141,15 +141,15 @@ class Photo(BaseAccountModel):
|
|||||||
try:
|
try:
|
||||||
image = urlopen(image_url)
|
image = urlopen(image_url)
|
||||||
# No idea how to test this
|
# No idea how to test this
|
||||||
# pragma: no cover # pylint: disable=invalid-name
|
# pragma: no cover
|
||||||
except HTTPError as e:
|
except HTTPError as exc:
|
||||||
print('%s import failed with an HTTP error: %s' %
|
print('%s import failed with an HTTP error: %s' %
|
||||||
(service_name, e.code))
|
(service_name, exc.code))
|
||||||
return False
|
return False
|
||||||
# No idea how to test this
|
# No idea how to test this
|
||||||
# pragma: no cover
|
# pragma: no cover
|
||||||
except URLError as e: # pylint: disable=invalid-name
|
except URLError as exc:
|
||||||
print('%s import failed: %s' % (service_name, e.reason))
|
print('%s import failed: %s' % (service_name, exc.reason))
|
||||||
return False
|
return False
|
||||||
data = image.read()
|
data = image.read()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user