Skip to content

Commit e39fe68

Browse files
committed
Use contextlib.closing with GeosLibrary url connection
1 parent 3b5011e commit e39fe68

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/basemap/utils/GeosLibrary.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def download(self):
8686
# Fallback if `urlopen` does not accept context.
8787
conn = urlopen(link)
8888

89-
with conn:
89+
with contextlib.closing(conn):
9090
# Try to get the file timestamp from the HTTP request header.
9191
date = conn.headers.get("Last-Modified")
9292
if date is not None:

0 commit comments

Comments
 (0)