8000 bpo-46987: Remove _PySys_GetObjectId / _PySys_GetObjectId (GH-31835) · python/cpython@bb1c543 · GitHub
[go: up one dir, main page]

Skip to content

Commit bb1c543

Browse files
authored
bpo-46987: Remove _PySys_GetObjectId / _PySys_GetObjectId (GH-31835)
1 parent 9523c0d commit bb1c543

File tree

3 files changed

+2
-38
lines changed

3 files changed

+2
-38
lines changed

Include/cpython/sysmodule.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
PyAPI_FUNC(PyObject *) _PySys_GetAttr(PyThreadState *tstate,
66
PyObject *name);
7-
PyAPI_FUNC(PyObject *) _PySys_GetObjectId(_Py_Identifier *key);
8-
PyAPI_FUNC(int) _PySys_SetObjectId(_Py_Identifier *key, PyObject *);
97

108
PyAPI_FUNC(size_t) _PySys_GetSizeOf(PyObject *);
119

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Remove private functions ``_PySys_GetObjectId()`` and ``_PySys_SetObjectId()``.
2+
Patch by Dong-hee Na.

Python/sysmodule.c

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -72,29 +72,6 @@ _PySys_GetAttr(PyThreadState *tstate, PyObject *name)
7272
return value;
7373
}
7474

75-
static PyObject *
76-
sys_get_object_id(PyThreadState *tstate, _Py_Identifier *key)
77-
{
78-
PyObject *sd = tstate->interp->sysdict;
79-
if (sd == NULL) {
80-
return NULL;
81-
}
82-
PyObject *exc_type, *exc_value, *exc_tb;
83-
_PyErr_Fetch(tstate, &exc_type, &exc_value, &exc_tb);
84-
PyObject *value = _PyDict_GetItemIdWithError(sd, key);
85-
/* XXX Suppress a new exception if it was raised and restore
86-
* the old one. */
87-
_PyErr_Restore(tstate, exc_type, exc_value, exc_tb);
88-
return value;
89-
}
90-
91-
PyObject *
92-
_PySys_GetObjectId(_Py_Identifier *key)
93-
{
94-
PyThreadState *tstate = _PyThreadState_GET();
95-
return sys_get_object_id(tstate, key);
96-
}
97-
9875
static PyObject *
9976
_PySys_GetObject(PyInterpreterState *interp, const char *name)
10077
{
@@ -139,19 +116,6 @@ sys_set_object(PyInterpreterState *interp, PyObject *key, PyObject *v)
139116
}
140117
}
141118

142-
static int
143-
sys_set_object_id(PyInterpreterState *interp, _Py_Identifier *key, PyObject *v)
144-
{
145-
return sys_set_object(interp, _PyUnicode_FromId(key), v);
146-
}
147-
148-
int
149-
_PySys_SetObjectId(_Py_Identifier *key, PyObject *v)
150-
{
151-
PyInterpreterState *interp = _PyInterpreterState_GET();
152-
return sys_set_object_id(interp, key, v);
153-
}
154-
155119
int
156120
_PySys_SetAttr(PyObject *key, PyObject *v)
157121
{

0 commit comments

Comments
 (0)
0