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 3d26f43 commit e6b585cCopy full SHA for e6b585c
setupext.py
@@ -32,6 +32,7 @@
32
33
import versioneer
34
import warnings
35
+import contextlib
36
37
if sys.version_info < (3, ):
38
from urllib2 import urlopen, Request
@@ -144,8 +145,8 @@ def write_cache(local_fn, data):
144
145
# jQueryUI's website blocks direct downloads from urllib.request's
146
# default User-Agent, but not (for example) wget; so I don't feel too
147
# bad passing in an empty User-Agent.
- with urlopen(
148
- Request(url, headers={"User-Agent": ""})) as req:
+ with contextlib.closing(urlopen(
149
+ Request(url, headers={"User-Agent": ""}))) as req:
150
file_contents = BytesIO(req.read())
151
file_contents.seek(0)
152
0 commit comments