Skip to content

Commit 5cf3015

Browse files
committed
Add Python 3.13 compatibility
1 parent 75ded9d commit 5cf3015

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

rdev.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ exclude_artifacts = [
1313
"opencv-cpp"
1414
]
1515

16-
robotpy_build_req = "<2025.0.0,~=2024.0.2"
16+
robotpy_build_req = "<2025.0.0b1,~=2025.0.0a1"
1717

1818
#
1919
# Subproject configuration

subprojects/robotpy-wpilib/wpilib/src/rpy/Notifier.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "frc/Timer.h"
1616

1717
#include <pybind11/functional.h>
18+
#include <gilsafe_object.h>
1819

1920
using namespace frc;
2021
using namespace pybind11::literals;
@@ -58,7 +59,7 @@ PyNotifier::PyNotifier(std::function<void()> handler) {
5859
if (handler)
5960
handler();
6061
}
61-
if (_Py_IsFinalizing()) {
62+
if (Py_IsFinalizing()) {
6263
release.disarm();
6364
}
6465
});

subprojects/robotpy-wpiutil/wpiutil/src/safethread_gil.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
#include <atomic>
3+
#include <gilsafe_object.h>
34
#include <robotpy_build.h>
45

56
using OnThreadStartFn = void *(*)();
@@ -17,7 +18,7 @@ struct SafeThreadState {
1718
std::atomic<bool> g_gilstate_managed = false;
1819

1920
void *on_safe_thread_start() {
20-
if (_Py_IsFinalizing() // python is shutting down
21+
if (Py_IsFinalizing() // python is shutting down
2122
|| !g_gilstate_managed.load() // python has shutdown)
2223
) {
2324
return nullptr;
@@ -37,7 +38,7 @@ void on_safe_thread_end(void *opaque) {
3738

3839
// don't cleanup if it's unsafe to do so. Several possibilities here:
3940
if (!opaque // internal error?
40-
|| _Py_IsFinalizing() // python is shutting down
41+
|| Py_IsFinalizing() // python is shutting down
4142
|| !g_gilstate_managed.load() // python has shutdown
4243
) {
4344
return;

0 commit comments

Comments
 (0)