summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-01-29 21:12:03 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-01-29 21:12:03 (GMT)
commit63b4d4b494d57c90461740d0700af15ae4420618 (patch)
tree7e3f3dfed66f55795f3286c30bbfe93480e3f882 /Lib
parent89ca85c7465020b181e7e8a6109fc893675fdf7b (diff)
downloadcpython-63b4d4b494d57c90461740d0700af15ae4420618.zip
cpython-63b4d4b494d57c90461740d0700af15ae4420618.tar.gz
cpython-63b4d4b494d57c90461740d0700af15ae4420618.tar.bz2
asyncio: _fatal_error() of _UnixWritePipeTransport and _ProactorBasePipeTransport shouldn't log BrokenPipeError nor ConnectionResetError.
(Same behaviour as _SelectorTransport._fatal_error().)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/asyncio/proactor_events.py3
-rw-r--r--Lib/asyncio/unix_events.py3
2 files changed, 4 insertions, 2 deletions
diff --git a/Lib/asyncio/proactor_events.py b/Lib/asyncio/proactor_events.py
index 3b44f24..d2553eb 100644
--- a/Lib/asyncio/proactor_events.py
+++ b/Lib/asyncio/proactor_events.py
@@ -54,7 +54,8 @@ class _ProactorBasePipeTransport(transports.BaseTransport):
self._read_fut.cancel()
def _fatal_error(self, exc):
- logger.exception('Fatal error for %s', self)
+ if not isinstance(exc, (BrokenPipeError, ConnectionResetError)):
+ logger.exception('Fatal error for %s', self)
self._force_close(exc)
def _force_close(self, exc):
diff --git a/Lib/asyncio/unix_events.py b/Lib/asyncio/unix_events.py
index 219c88a..a1aff3f 100644
--- a/Lib/asyncio/unix_events.py
+++ b/Lib/asyncio/unix_events.py
@@ -363,7 +363,8 @@ class _UnixWritePipeTransport(transports.WriteTransport):
def _fatal_error(self, exc):
# should be called by exception handler only
- logger.exception('Fatal error for %s', self)
+ if not isinstance(exc, (BrokenPipeError, ConnectionResetError)):
+ logger.exception('Fatal error for %s', self)
self._close(exc)
def _close(self, exc=None):