Skip to content
Myr

Changed ConnectionError to InvalidURL

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by ContinuousFunction · committed by ContinuousFunction · parent 087a27a · Browse files · 2 files+3 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+3 added−3 removed

  • other:+3 added−3 removed

2 files+3 added−3 removed

modified:requests/models.py+1 added-1 removed
352 unmodified lines
353 # Support for unicode domain names and paths.354 try:355 scheme, auth, host, port, path, query, fragment = parse_url(url)356 except LocationParseError as e:357 raise ConnectionError(e.message)357 raise InvalidURL(e.message)358359 if not scheme:360 raise MissingSchema("Invalid URL {0!r}: No schema supplied. "361 "Perhaps you meant http://{0}?".format(url))
479 unmodified lines
modified:test_requests.py+2 added-2 removed
308 unmodified lines
309 with pytest.raises(ConnectionError):310 requests.get("http://httpbin.org:1")311312 def test_LocationParseError(self):313 """Inputing a URL that cannot be parsed should raise a ConnectionError"""314 with pytest.raises(ConnectionError):313 """Inputing a URL that cannot be parsed should raise an InvalidURL error"""314 with pytest.raises(InvalidURL):315 requests.get("http://fe80::5054:ff:fe5a:fc0")316317 def test_basicauth_with_netrc(self):318 auth = ('user', 'pass')
1220 unmodified lines