Catch 'BrokenPipeError' exceptions for ADB commands (#19011)

This commit is contained in:
Jeff Irion 2018-12-05 08:04:08 -08:00 committed by Teemu R
parent 3627de3e8a
commit 16e25f2039

View File

@ -125,7 +125,7 @@ class FireTVDevice(MediaPlayerDevice):
def __init__(self, ftv, name, get_source, get_sources):
"""Initialize the FireTV device."""
from adb.adb_protocol import (
InvalidCommandError, InvalidResponseError, InvalidChecksumError)
InvalidChecksumError, InvalidCommandError, InvalidResponseError)
self.firetv = ftv
@ -137,9 +137,9 @@ class FireTVDevice(MediaPlayerDevice):
self.adb_lock = threading.Lock()
# ADB exceptions to catch
self.exceptions = (TypeError, ValueError, AttributeError,
InvalidCommandError, InvalidResponseError,
InvalidChecksumError)
self.exceptions = (AttributeError, BrokenPipeError, TypeError,
ValueError, InvalidChecksumError,
InvalidCommandError, InvalidResponseError)
self._state = None
self._available = self.firetv.available