remove unnecessary else

pull/618/head
Nolan Gilley 2015-11-14 15:49:39 -05:00
parent 9acb341b96
commit df264f2ec0
1 changed files with 10 additions and 11 deletions

View File

@ -134,19 +134,18 @@ def setup(hass, config):
img_bytes = camera.camera_image() img_bytes = camera.camera_image()
if img_bytes is None: if img_bytes is None:
continue continue
else: headers_str = '\r\n'.join((
headers_str = '\r\n'.join(( 'Content-length: {}'.format(len(img_bytes)),
'Content-length: {}'.format(len(img_bytes)), 'Content-type: image/jpeg',
'Content-type: image/jpeg', )) + '\r\n\r\n'
)) + '\r\n\r\n'
handler.request.sendall( handler.request.sendall(
bytes(headers_str, 'utf-8') + bytes(headers_str, 'utf-8') +
img_bytes + img_bytes +
bytes('\r\n', 'utf-8')) bytes('\r\n', 'utf-8'))
handler.request.sendall( handler.request.sendall(
bytes('--jpgboundary\r\n', 'utf-8')) bytes('--jpgboundary\r\n', 'utf-8'))
except (requests.RequestException, IOError): except (requests.RequestException, IOError):
camera.is_streaming = False camera.is_streaming = False