Previously, EOFErrors were being created with no text, leading to bad
looking error messages.
if exc is None:
# EOF we triggered. Is there a better way to do this?
try:
- raise EOFError
+ raise EOFError('EOF')
except EOFError as e:
self.recvfrom.set_exception(e)
else:
while count > 0:
n = await sock.recv(count, _timeout(expiration))
if n == b"":
- raise EOFError
+ raise EOFError('EOF')
count = count - len(n)
s = s + n
return s
try:
n = sock.recv(count)
if n == b"":
- raise EOFError
+ raise EOFError('EOF')
count -= len(n)
s += n
except (BlockingIOError, ssl.SSLWantReadError):