Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GH-90699: Remove_Py_IDENTIFIER usage from_json module#98956

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
miss-islington merged 6 commits intopython:mainfromkumaraditya303:json
Nov 2, 2022
Merged
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
NextNext commit
port json
  • Loading branch information
@kumaraditya303
kumaraditya303 authoredNov 1, 2022
commit75a2b4aec913b267a95ef037e8b8b920539141a0
16 changes: 3 additions & 13 deletionsModules/_json.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,6 @@
#ifndef Py_BUILD_CORE_BUILTIN
# define Py_BUILD_CORE_MODULE 1
#endif
#define NEEDS_PY_IDENTIFIER

#include "Python.h"
#include "pycore_ceval.h" // _Py_EnterRecursiveCall()
Expand DownExpand Up@@ -304,20 +303,11 @@ escape_unicode(PyObject *pystr)
static void
raise_errmsg(const char *msg, PyObject *s, Py_ssize_t end)
{
/* Use JSONDecodeError exception to raise a nice looking ValueError subclass */
_Py_static_string(PyId_decoder, "json.decoder");
PyObject *decoder = _PyImport_GetModuleId(&PyId_decoder);
if (decoder == NULL) {
return;
}

_Py_IDENTIFIER(JSONDecodeError);
PyObject *JSONDecodeError = _PyObject_GetAttrId(decoder, &PyId_JSONDecodeError);
Py_DECREF(decoder);
PyObject *JSONDecodeError =
_PyImport_GetModuleAttrString("json.decoder", "JSONDecodeError");
if (JSONDecodeError == NULL) {
return;
}

PyObject *exc;
exc = PyObject_CallFunction(JSONDecodeError, "zOn", msg, s, end);
Py_DECREF(JSONDecodeError);
Expand DownExpand Up@@ -1530,7 +1520,7 @@ encoder_encode_key_value(PyEncoderObject *s, _PyUnicodeWriter *writer, bool *fir

if (*first) {
*first = false;
}
}
else {
if (_PyUnicodeWriter_WriteStr(writer, s->item_separator) < 0) {
Py_DECREF(keystr);
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp