Skip to content
This repository has been archived by the owner on May 25, 2024. It is now read-only.

Commit

Permalink
fix: fix symbol not found for python < 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Antares0982 committed Mar 27, 2024
1 parent a9f57a3 commit c87ca26
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/pycJSON_decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,19 +563,22 @@ static cJSON_bool parse_value(PyObject **item, parse_buffer *const input_buffer)
/* parse the different types of values */
/* null */
if (can_read(input_buffer, 4) && (strncmp((const char *) buffer_at_offset(input_buffer), "null", 4) == 0)) {
*item = Py_NewRef(Py_None);
Py_INCREF(Py_None);
*item = Py_None;
input_buffer->offset += 4;
return true;
}
/* false */
if (can_read(input_buffer, 5) && (strncmp((const char *) buffer_at_offset(input_buffer), "false", 5) == 0)) {
*item = Py_NewRef(Py_False);
Py_INCREF(Py_False);
*item = Py_False;
input_buffer->offset += 5;
return true;
}
/* true */
if (can_read(input_buffer, 4) && (strncmp((const char *) buffer_at_offset(input_buffer), "true", 4) == 0)) {
*item = Py_NewRef(Py_True);
Py_INCREF(Py_True);
*item = Py_True;
input_buffer->offset += 4;
return true;
}
Expand Down

0 comments on commit c87ca26

Please sign in to comment.