From d04858efe01a33e419fa220b5f37d91839bf847e Mon Sep 17 00:00:00 2001 From: Jacob Dahl <37091262+dakejahl@users.noreply.github.com> Date: Mon, 16 Mar 2026 14:49:21 -0800 Subject: [PATCH] fix(uavcan): silence DroneCAN DSDL compiler build warnings (#26757) Fix Python DeprecationWarning for invalid escape sequence in pyratemp.py and replace deprecated FindPythonInterp CMake module in libuavcan. --- src/drivers/uavcan/libdronecan/libuavcan/CMakeLists.txt | 5 ++++- .../dsdl_compiler/libuavcan_dsdl_compiler/pyratemp.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/drivers/uavcan/libdronecan/libuavcan/CMakeLists.txt b/src/drivers/uavcan/libdronecan/libuavcan/CMakeLists.txt index 8e095162e2..87f5353216 100644 --- a/src/drivers/uavcan/libdronecan/libuavcan/CMakeLists.txt +++ b/src/drivers/uavcan/libdronecan/libuavcan/CMakeLists.txt @@ -21,7 +21,10 @@ endif () project(libuavcan) -find_package(PythonInterp) +if(NOT PYTHON_EXECUTABLE) + find_package(Python3 COMPONENTS Interpreter) + set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) +endif() if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") set(COMPILER_IS_GCC_COMPATIBLE 1) diff --git a/src/drivers/uavcan/libdronecan/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/pyratemp.py b/src/drivers/uavcan/libdronecan/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/pyratemp.py index ed117b7c01..4497db1fce 100755 --- a/src/drivers/uavcan/libdronecan/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/pyratemp.py +++ b/src/drivers/uavcan/libdronecan/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/pyratemp.py @@ -278,7 +278,7 @@ def escape(s, format=HTML): - `NONE`: nothing is replaced - `HTML`: replace &<>'" by &...; - - `LATEX`: replace \#$%&_{}~^ + - `LATEX`: replace \\#$%&_{}~^ - `MAIL_HEADER`: escape non-ASCII mail-header-contents :Returns: the escaped string in unicode