Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 00f4648

Browse files
committed
Merge 3.5 (asyncio)
2 parents 89d3f53 + c94a93a commit 00f4648

5 files changed

Lines changed: 10 additions & 5 deletions

File tree

Lib/asyncio/base_events.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@
5454
# before cleanup of cancelled handles is performed.
5555
_MIN_CANCELLED_TIMER_HANDLES_FRACTION = 0.5
5656

57+
# Exceptions which must not call the exception handler in fatal error
58+
# methods (_fatal_error())
59+
_FATAL_ERROR_IGNORE = (BrokenPipeError,
60+
ConnectionResetError, ConnectionAbortedError)
61+
62+
5763
def _format_handle(handle):
5864
cb = handle._callback
5965
if inspect.ismethod(cb) and isinstance(cb.__self__, tasks.Task):

Lib/asyncio/proactor_events.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def __del__(self):
9191
self.close()
9292

9393
def _fatal_error(self, exc, message='Fatal error on pipe transport'):
94-
if isinstance(exc, (BrokenPipeError, ConnectionResetError)):
94+
if isinstance(exc, base_events._FATAL_ERROR_IGNORE):
9595
if self._loop.get_debug():
9696
logger.debug("%r: %s", self, message, exc_info=True)
9797
else:

Lib/asyncio/selector_events.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,8 +579,7 @@ def __del__(self):
579579

580580
def _fatal_error(self, exc, message='Fatal error on transport'):
581581
# Should be called from exception handler only.
582-
if isinstance(exc, (BrokenPipeError,
583-
ConnectionResetError, ConnectionAbortedError)):
582+
if isinstance(exc, base_events._FATAL_ERROR_IGNORE):
584583
if self._loop.get_debug():
585584
logger.debug("%r: %s", self, message, exc_info=True)
586585
else:

Lib/asyncio/sslproto.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ def _process_write_backlog(self):
656656

657657
def _fatal_error(self, exc, message='Fatal error on transport'):
658658
# Should be called from exception handler only.
659-
if isinstance(exc, (BrokenPipeError, ConnectionResetError)):
659+
if isinstance(exc, base_events._FATAL_ERROR_IGNORE):
660660
if self._loop.get_debug():
661661
logger.debug("%r: %s", self, message, exc_info=True)
662662
else:

Lib/asyncio/unix_events.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ def abort(self):
577577

578578
def _fatal_error(self, exc, message='Fatal error on pipe transport'):
579579
# should be called by exception handler only
580-
if isinstance(exc, (BrokenPipeError, ConnectionResetError)):
580+
if isinstance(exc, base_events._FATAL_ERROR_IGNORE):
581581
if self._loop.get_debug():
582582
logger.debug("%r: %s", self, message, exc_info=True)
583583
else:

0 commit comments

Comments
 (0)