We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 019a7b6 commit 4b003caCopy full SHA for 4b003ca
packet/context_processors.py
@@ -62,9 +62,9 @@ def get_rit_image(username: str) -> str:
62
for addr in addresses:
63
url = 'https://gravatar.com/avatar/' + hashlib.md5(addr.encode('utf8')).hexdigest() + '.jpg?d=404&s=250'
64
try:
65
- gravatar = urllib.request.urlopen(url)
66
- if gravatar.getcode() == 200:
67
- return url
+ with urllib.request.urlopen(url) as gravatar:
+ if gravatar.getcode() == 200:
+ return url
68
except:
69
continue
70
return 'https://www.gravatar.com/avatar/freshmen?d=mp&f=y'
0 commit comments