Skip to content

Commit c47264f

Browse files
committed
[GR-66050] Update patch for orjson 3.10.5.
PullRequest: graalpython/3899
2 parents 24134d6 + 7739e30 commit c47264f

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

graalpython/lib-graalpython/patches/orjson-3.10.5.patch

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,22 @@ index 9cfd4d7..4231d18 100644
144144
let obj = Box::new(Fragment {
145145
ob_refcnt: 1,
146146
diff --git a/src/lib.rs b/src/lib.rs
147-
index 0ae348e..13508ea 100644
147+
index 0ae348e..b712f4e 100644
148148
--- a/src/lib.rs
149149
+++ b/src/lib.rs
150-
@@ -230,11 +230,20 @@ fn raise_loads_exception(err: deserialize::DeserializeError) -> *mut PyObject {
150+
@@ -181,8 +181,9 @@ pub unsafe extern "C" fn PyInit_orjson() -> *mut PyModuleDef {
151+
},
152+
#[cfg(Py_3_12)]
153+
PyModuleDef_Slot {
154+
- slot: Py_mod_multiple_interpreters,
155+
- value: Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED,
156+
+ // Following symbols are not exported by the PyO3 version we use
157+
+ slot: 3 /*Py_mod_multiple_interpreters*/,
158+
+ value: null_mut() /*Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED*/,
159+
},
160+
#[cfg(Py_3_13)]
161+
PyModuleDef_Slot {
162+
@@ -230,11 +231,20 @@ fn raise_loads_exception(err: deserialize::DeserializeError) -> *mut PyObject {
151163
PyUnicode_FromStringAndSize(msg.as_ptr() as *const c_char, msg.len() as isize);
152164
let args = PyTuple_New(3);
153165
let pos = PyLong_FromLongLong(pos);
@@ -172,7 +184,7 @@ index 0ae348e..13508ea 100644
172184
Py_DECREF(args);
173185
};
174186
null_mut()
175-
@@ -248,7 +257,7 @@ fn raise_dumps_exception_fixed(msg: &str) -> *mut PyObject {
187+
@@ -248,7 +258,7 @@ fn raise_dumps_exception_fixed(msg: &str) -> *mut PyObject {
176188
let err_msg =
177189
PyUnicode_FromStringAndSize(msg.as_ptr() as *const c_char, msg.len() as isize);
178190
PyErr_SetObject(typeref::JsonEncodeError, err_msg);
@@ -181,7 +193,7 @@ index 0ae348e..13508ea 100644
181193
Py_DECREF(err_msg);
182194
};
183195
null_mut()
184-
@@ -265,7 +274,7 @@ fn raise_dumps_exception_dynamic(err: &str) -> *mut PyObject {
196+
@@ -265,7 +275,7 @@ fn raise_dumps_exception_dynamic(err: &str) -> *mut PyObject {
185197
let err_msg =
186198
PyUnicode_FromStringAndSize(err.as_ptr() as *const c_char, err.len() as isize);
187199
PyErr_SetObject(typeref::JsonEncodeError, err_msg);
@@ -190,7 +202,7 @@ index 0ae348e..13508ea 100644
190202
Py_DECREF(err_msg);
191203

192204
if !cause_exc.is_null() {
193-
@@ -291,7 +300,7 @@ fn raise_dumps_exception_dynamic(err: &str) -> *mut PyObject {
205+
@@ -291,7 +301,7 @@ fn raise_dumps_exception_dynamic(err: &str) -> *mut PyObject {
194206
let err_msg =
195207
PyUnicode_FromStringAndSize(err.as_ptr() as *const c_char, err.len() as isize);
196208
PyErr_SetObject(typeref::JsonEncodeError, err_msg);
@@ -199,7 +211,7 @@ index 0ae348e..13508ea 100644
199211
Py_DECREF(err_msg);
200212
let mut tp: *mut PyObject = null_mut();
201213
let mut val: *mut PyObject = null_mut();
202-
@@ -345,7 +354,10 @@ pub unsafe extern "C" fn dumps(
214+
@@ -345,7 +355,10 @@ pub unsafe extern "C" fn dumps(
203215
}
204216
if unlikely!(!kwnames.is_null()) {
205217
for i in 0..=Py_SIZE(kwnames).saturating_sub(1) {
@@ -210,7 +222,7 @@ index 0ae348e..13508ea 100644
210222
if arg == typeref::DEFAULT {
211223
if unlikely!(num_args & 2 == 2) {
212224
return raise_dumps_exception_fixed(
213-
@@ -369,7 +381,7 @@ pub unsafe extern "C" fn dumps(
225+
@@ -369,7 +382,7 @@ pub unsafe extern "C" fn dumps(
214226
let mut optsbits: i32 = 0;
215227
if unlikely!(optsptr.is_some()) {
216228
let opts = optsptr.unwrap();

0 commit comments

Comments
 (0)