Skip to content

Commit 275f0c4

Browse files
committed
Add patch for optree
1 parent 705197c commit 275f0c4

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

graalpython/lib-graalpython/patches/metadata.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,10 @@ dist-type = 'sdist'
388388
version = '1.17.1'
389389
url = 'https://github.com/microsoft/onnxruntime/archive/refs/tags/v1.17.1.tar.gz'
390390

391+
[[optree.rules]]
392+
patch = 'optree.patch'
393+
license = 'Apache-2.0'
394+
391395
[[orjson.rules]]
392396
version = '== 3.9.7'
393397
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)