Skip to content

Commit 4b003ca

Browse files
committed
fix lint
1 parent 019a7b6 commit 4b003ca

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packet/context_processors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ def get_rit_image(username: str) -> str:
6262
for addr in addresses:
6363
url = 'https://gravatar.com/avatar/' + hashlib.md5(addr.encode('utf8')).hexdigest() + '.jpg?d=404&s=250'
6464
try:
65-
gravatar = urllib.request.urlopen(url)
66-
if gravatar.getcode() == 200:
67-
return url
65+
with urllib.request.urlopen(url) as gravatar:
66+
if gravatar.getcode() == 200:
67+
return url
6868
except:
6969
continue
7070
return 'https://www.gravatar.com/avatar/freshmen?d=mp&f=y'

0 commit comments

Comments
 (0)