[libcamera-devel] [PATCH 5/5] py: Fix None value in ControlType enum

Laurent Pinchart laurent.pinchart at ideasonboard.com
Thu May 19 12:52:35 CEST 2022


Hi Tomi,

Thank you for the patch.

On Thu, May 19, 2022 at 01:33:47PM +0300, Tomi Valkeinen wrote:
> "None" is not a valid name for an enum value, so change it to "Null".

If only all programming languages had the same reserved keywords :-)

Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

> Signed-off-by: Tomi Valkeinen <tomi.valkeinen at ideasonboard.com>
> ---
>  src/py/libcamera/py_enums.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/py/libcamera/py_enums.cpp b/src/py/libcamera/py_enums.cpp
> index e55318f1..96d4beef 100644
> --- a/src/py/libcamera/py_enums.cpp
> +++ b/src/py/libcamera/py_enums.cpp
> @@ -22,7 +22,7 @@ void init_py_enums(py::module &m)
>  		.value("Viewfinder", StreamRole::Viewfinder);
>  
>  	py::enum_<ControlType>(m, "ControlType")
> -		.value("None", ControlType::ControlTypeNone)
> +		.value("Null", ControlType::ControlTypeNone)
>  		.value("Bool", ControlType::ControlTypeBool)
>  		.value("Byte", ControlType::ControlTypeByte)
>  		.value("Integer32", ControlType::ControlTypeInteger32)

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list