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

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 0 additions & 2 deletions 2 Include/cpython/sysmodule.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

PyAPI_FUNC(PyObject *) _PySys_GetAttr(PyThreadState *tstate,
PyObject *name);
PyAPI_FUNC(PyObject *) _PySys_GetObjectId(_Py_Identifier *key);
PyAPI_FUNC(int) _PySys_SetObjectId(_Py_Identifier *key, PyObject *);

PyAPI_FUNC(size_t) _PySys_GetSizeOf(PyObject *);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Remove private functions ``_PySys_GetObjectId()`` and ``_PySys_SetObjectId()``.
Patch by Dong-hee Na.
36 changes: 0 additions & 36 deletions 36 Python/sysmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,29 +72,6 @@ _PySys_GetAttr(PyThreadState *tstate, PyObject *name)
return value;
}

static PyObject *
sys_get_object_id(PyThreadState *tstate, _Py_Identifier *key)
{
PyObject *sd = tstate->interp->sysdict;
if (sd == NULL) {
return NULL;
}
PyObject *exc_type, *exc_value, *exc_tb;
_PyErr_Fetch(tstate, &exc_type, &exc_value, &exc_tb);
PyObject *value = _PyDict_GetItemIdWithError(sd, key);
/* XXX Suppress a new exception if it was raised and restore
* the old one. */
_PyErr_Restore(tstate, exc_type, exc_value, exc_tb);
return value;
}

PyObject *
_PySys_GetObjectId(_Py_Identifier *key)
{
PyThreadState *tstate = _PyThreadState_GET();
return sys_get_object_id(tstate, key);
}

static PyObject *
_PySys_GetObject(PyInterpreterState *interp, const char *name)
{
Expand Down Expand Up @@ -139,19 +116,6 @@ sys_set_object(PyInterpreterState *interp, PyObject *key, PyObject *v)
}
}

static int
sys_set_object_id(PyInterpreterState *interp, _Py_Identifier *key, PyObject *v)
{
return sys_set_object(interp, _PyUnicode_FromId(key), v);
}

int
_PySys_SetObjectId(_Py_Identifier *key, PyObject *v)
{
PyInterpreterState *interp = _PyInterpreterState_GET();
return sys_set_object_id(interp, key, v);
}

int
_PySys_SetAttr(PyObject *key, PyObject *v)
{
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.