|
@@ -218,9 +218,7 @@ class ResultHandler(_pool.ResultHandler):
|
|
|
n = __read__(
|
|
|
fd, bufv[Hr:] if readcanbuf else bufv, 4 - Hr,
|
|
|
)
|
|
|
- except OSError as exc:
|
|
|
- if exc.errno not in UNAVAIL:
|
|
|
- raise
|
|
|
+ except (BlockingIOError, InterruptedError):
|
|
|
yield
|
|
|
else:
|
|
|
if n == 0:
|
|
@@ -240,9 +238,7 @@ class ResultHandler(_pool.ResultHandler):
|
|
|
n = __read__(
|
|
|
fd, bufv[Br:] if readcanbuf else bufv, body_size - Br,
|
|
|
)
|
|
|
- except OSError as exc:
|
|
|
- if exc.errno not in UNAVAIL:
|
|
|
- raise
|
|
|
+ except (BlockingIOError, InterruptedError):
|
|
|
yield
|
|
|
else:
|
|
|
if n == 0:
|
|
@@ -830,9 +826,7 @@ class AsynPool(_pool.Pool):
|
|
|
while Hw < 4:
|
|
|
try:
|
|
|
Hw += send(header, Hw)
|
|
|
- except Exception as exc:
|
|
|
- if getattr(exc, 'errno', None) not in UNAVAIL:
|
|
|
- raise
|
|
|
+ except (BlockingIOError, InterruptedError) as exc:
|
|
|
# suspend until more data
|
|
|
errors += 1
|
|
|
if errors > 100:
|
|
@@ -846,9 +840,7 @@ class AsynPool(_pool.Pool):
|
|
|
while Bw < body_size:
|
|
|
try:
|
|
|
Bw += send(body, Bw)
|
|
|
- except Exception as exc:
|
|
|
- if getattr(exc, 'errno', None) not in UNAVAIL:
|
|
|
- raise
|
|
|
+ except (BlockingIOError, InterruptedError) as exc:
|
|
|
# suspend until more data
|
|
|
errors += 1
|
|
|
if errors > 100:
|
|
@@ -895,18 +887,14 @@ class AsynPool(_pool.Pool):
|
|
|
while Hw < 4:
|
|
|
try:
|
|
|
Hw += send(header, Hw)
|
|
|
- except Exception as exc:
|
|
|
- if getattr(exc, 'errno', None) not in UNAVAIL:
|
|
|
- raise
|
|
|
+ except (BlockingIOError, InterruptedError):
|
|
|
yield
|
|
|
|
|
|
# write body
|
|
|
while Bw < body_size:
|
|
|
try:
|
|
|
Bw += send(body, Bw)
|
|
|
- except Exception as exc:
|
|
|
- if getattr(exc, 'errno', None) not in UNAVAIL:
|
|
|
- raise
|
|
|
+ except (BlockingIOError, InterruptedError):
|
|
|
# suspend until more data
|
|
|
yield
|
|
|
finally:
|