Added fix for mypy in 3.7

This commit is contained in:
Josh Miklos
2020-06-22 16:45:27 -07:00
parent 7c5d521b9c
commit 3af4562ce2

View File

@ -61,7 +61,7 @@ def pub_cam_loop_pyv4l2(
) )
else: else:
if "usb" in cam_id: if "usb" in cam_id:
cam = get_camera_by_bus_info(cam_id, *request_size) cam = get_camera_by_bus_info(cam_id, *request_size) # type: ignore
else: else:
cam = get_camera_by_string(cam_id, *request_size) # type: ignore cam = get_camera_by_string(cam_id, *request_size) # type: ignore
else: else:
@ -85,9 +85,9 @@ def pub_cam_loop_pyv4l2(
frame_bytes = cam.get_frame() # type: bytes frame_bytes = cam.get_frame() # type: bytes
if cam.pixel_format == "MJPEG": if cam.pixel_format == "MJPEG":
nd_frame = convert_mjpeg(frame_bytes) nd_frame = convert_mjpeg(frame_bytes) # type: ignore
elif cam.pixel_format == "RGB24": elif cam.pixel_format == "RGB24":
nd_frame = convert_rgb24(frame_bytes, cam.width, cam.height) nd_frame = convert_rgb24(frame_bytes, cam.width, cam.height) # type: ignore
else: else:
raise NotImplementedError(f"{cam.pixel_format} format not supported.") raise NotImplementedError(f"{cam.pixel_format} format not supported.")