mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Changed ConnectionError to InvalidURL
This commit is contained in:
+1
-1
@@ -354,7 +354,7 @@ class PreparedRequest(RequestEncodingMixin, RequestHooksMixin):
|
||||
try:
|
||||
scheme, auth, host, port, path, query, fragment = parse_url(url)
|
||||
except LocationParseError as e:
|
||||
raise ConnectionError(e.message)
|
||||
raise InvalidURL(e.message)
|
||||
|
||||
if not scheme:
|
||||
raise MissingSchema("Invalid URL {0!r}: No schema supplied. "
|
||||
|
||||
+2
-2
@@ -310,8 +310,8 @@ class RequestsTestCase(unittest.TestCase):
|
||||
requests.get("http://httpbin.org:1")
|
||||
|
||||
def test_LocationParseError(self):
|
||||
"""Inputing a URL that cannot be parsed should raise a ConnectionError"""
|
||||
with pytest.raises(ConnectionError):
|
||||
"""Inputing a URL that cannot be parsed should raise an InvalidURL error"""
|
||||
with pytest.raises(InvalidURL):
|
||||
requests.get("http://fe80::5054:ff:fe5a:fc0")
|
||||
|
||||
def test_basicauth_with_netrc(self):
|
||||
|
||||
Reference in New Issue
Block a user