Skip to content

Commit 42145fa

Browse files
committed
Add patch for optree
1 parent 93821c0 commit 42145fa

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

graalpython/lib-graalpython/patches/metadata.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,10 @@ dist-type = 'sdist'
413413
version = '1.22.1'
414414
url = 'https://github.com/microsoft/onnxruntime/archive/refs/tags/v1.22.1.tar.gz'
415415

416+
[[optree.rules]]
417+
patch = 'optree.patch'
418+
license = 'Apache-2.0'
419+
416420
[[orjson.rules]]
417421
version = '== 3.9.7'
418422
patch = 'orjson-3.9.7.patch'
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/include/optree/pymacros.h b/include/optree/pymacros.h
2+
index 7f2ac9a..ecb6faf 100644
3+
--- a/include/optree/pymacros.h
4+
+++ b/include/optree/pymacros.h
5+
@@ -52,7 +52,7 @@ namespace py = pybind11;
6+
# define Py_IsFalse(x) Py_Is((x), Py_False)
7+
#endif
8+
9+
-inline constexpr Py_ALWAYS_INLINE bool Py_IsConstant(PyObject *x) noexcept {
10+
+inline Py_ALWAYS_INLINE bool Py_IsConstant(PyObject *x) noexcept {
11+
return Py_IsNone(x) || Py_IsTrue(x) || Py_IsFalse(x);
12+
}
13+
#define Py_IsConstant(x) Py_IsConstant(x)

0 commit comments

Comments
 (0)