Mercurial > cpython-lru_cache-weakref
changeset 1590:ac2e5cc29949 legacy-trunk
Added tests for missing host to open_http and open_gopher
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Mon, 18 Apr 1994 09:39:56 +0000 |
| parents | 7fdeadfa83e0 |
| children | ac9e12b4ea8c |
| files | Lib/urllib.py |
| diffstat | 1 files changed, 2 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/Lib/urllib.py Sat Apr 16 08:29:27 1994 +0000 +++ b/Lib/urllib.py Mon Apr 18 09:39:56 1994 +0000 @@ -132,6 +132,7 @@ def open_http(self, url): import httplib host, selector = splithost(url) + if not host: raise IOError, ('http error', 'no host given') h = httplib.HTTP(host) h.putrequest('GET', selector) for args in self.addheaders: apply(h.putheader, args) @@ -143,6 +144,7 @@ def open_gopher(self, url): import gopherlib host, selector = splithost(url) + if not host: raise IOError, ('gopher error', 'no host given') type, selector = splitgophertype(selector) selector, query = splitquery(selector) if query: fp = gopherlib.send_query(selector, query, host)
