mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +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