Skip to content

Commit 5198d44

Browse files
authored
Fix file:// protocol not working in Ports.fetch_project (#21456)
1 parent 22a1c04 commit 5198d44

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/ports/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,8 @@ def retrieve():
300300
import requests
301301
response = requests.get(url)
302302
data = response.content
303-
except ImportError:
303+
except (ImportError, requests.exceptions.InvalidSchema):
304+
# requests does not support 'file://' protocol and raises InvalidSchema
304305
from urllib.request import urlopen
305306
f = urlopen(url)
306307
data = f.read()

0 commit comments

Comments
 (0)