[libcamera-devel,5/5] py: Fix None value in ControlType enum
diff mbox series

Message ID 20220519103347.33295-6-tomi.valkeinen@ideasonboard.com
State Accepted
Headers show
Series
  • More misc Python patches
Related show

Commit Message

Tomi Valkeinen May 19, 2022, 10:33 a.m. UTC
"None" is not a valid name for an enum value, so change it to "Null".

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
---
 src/py/libcamera/py_enums.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Laurent Pinchart May 19, 2022, 10:52 a.m. UTC | #1
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@ideasonboard.com>

> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@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)

Patch
diff mbox series

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)