mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-28 05:32:51 +01:00
We should also be catching timeouts on the read.
This commit is contained in:
parent
a76036722e
commit
1300548d0a
@ -69,10 +69,13 @@ def getUrlFd(url):
|
||||
def getUrl(url, size=None):
|
||||
"""Gets a page. Returns a string that is the page gotten."""
|
||||
fd = getUrlFd(url)
|
||||
if size is None:
|
||||
text = fd.read()
|
||||
else:
|
||||
text = fd.read(size)
|
||||
try:
|
||||
if size is None:
|
||||
text = fd.read()
|
||||
else:
|
||||
text = fd.read(size)
|
||||
except socket.timeout, e:
|
||||
raise WebError, TIMED_OUT
|
||||
fd.close()
|
||||
return text
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user