@@ -144,10 +144,22 @@ index 9cfd4d7..4231d18 100644
144
144
let obj = Box::new(Fragment {
145
145
ob_refcnt: 1,
146
146
diff --git a/src/lib.rs b/src/lib.rs
147
- index 0ae348e..13508ea 100644
147
+ index 0ae348e..b712f4e 100644
148
148
--- a/src/lib.rs
149
149
+++ 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 {
151
163
PyUnicode_FromStringAndSize(msg.as_ptr() as *const c_char, msg.len() as isize);
152
164
let args = PyTuple_New(3);
153
165
let pos = PyLong_FromLongLong(pos);
@@ -172,7 +184,7 @@ index 0ae348e..13508ea 100644
172
184
Py_DECREF(args);
173
185
};
174
186
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 {
176
188
let err_msg =
177
189
PyUnicode_FromStringAndSize(msg.as_ptr() as *const c_char, msg.len() as isize);
178
190
PyErr_SetObject(typeref::JsonEncodeError, err_msg);
@@ -181,7 +193,7 @@ index 0ae348e..13508ea 100644
181
193
Py_DECREF(err_msg);
182
194
};
183
195
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 {
185
197
let err_msg =
186
198
PyUnicode_FromStringAndSize(err.as_ptr() as *const c_char, err.len() as isize);
187
199
PyErr_SetObject(typeref::JsonEncodeError, err_msg);
@@ -190,7 +202,7 @@ index 0ae348e..13508ea 100644
190
202
Py_DECREF(err_msg);
191
203
192
204
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 {
194
206
let err_msg =
195
207
PyUnicode_FromStringAndSize(err.as_ptr() as *const c_char, err.len() as isize);
196
208
PyErr_SetObject(typeref::JsonEncodeError, err_msg);
@@ -199,7 +211,7 @@ index 0ae348e..13508ea 100644
199
211
Py_DECREF(err_msg);
200
212
let mut tp: *mut PyObject = null_mut();
201
213
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(
203
215
}
204
216
if unlikely!(!kwnames.is_null()) {
205
217
for i in 0..=Py_SIZE(kwnames).saturating_sub(1) {
@@ -210,7 +222,7 @@ index 0ae348e..13508ea 100644
210
222
if arg == typeref::DEFAULT {
211
223
if unlikely!(num_args & 2 == 2) {
212
224
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(
214
226
let mut optsbits: i32 = 0;
215
227
if unlikely!(optsptr.is_some()) {
216
228
let opts = optsptr.unwrap();
0 commit comments