bpo-30732: json.dumps() lacks information about RecursionError relate…#2857
bpo-30732: json.dumps() lacks information about RecursionError relate…#2857soolabettu wants to merge 4 commits intopython:mainfrom
Conversation
…d to default function
Modules/_json.c
Outdated
| } | ||
| } | ||
| newobj = PyObject_CallFunctionObjArgs(s->defaultfn, obj, NULL); | ||
| if (obj != NULL && newobj != NULL && newobj->ob_type == obj->ob_type) { |
There was a problem hiding this comment.
How about if (PyObject_IsInstance(newobj, (PyObject *) Py_TYPE(obj))) { ?
Also, I think this can put above the check of if (newobj == NULL)
There was a problem hiding this comment.
Wouldn't PyObject_IsInstance raise false positives for our condition? For this fix, we would want the exact types to match, isn't it?
…d to default function
serhiy-storchaka
left a comment
There was a problem hiding this comment.
I'm not sure this is the right solution. Here are just style comments.
…d to default function
|
Ignore the identation changes please, its still not aligned. |
…d to default function
|
This PR is stale because it has been open for 30 days with no activity. |
|
This PR is stale because it has been open for 30 days with no activity. |
|
I was not able to modify the original PR, so I created a new one: #113458. |
|
This PR is stale because it has been open for 30 days with no activity. |
|
Fixed in #122165 instead. |
Please review.
https://bugs.python.org/issue30732
#74917