diff options
author | Dong-hee Na <donghee.na@python.org> | 2022-03-14 21:48:00 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-14 21:48:00 +0900 |
commit | bb1c543f4a183f5cfdf15aad59f59094d50b37fd (patch) | |
tree | d4f615f77b6b8289e5f4e77dd835fc6e458c55f2 /Python/sysmodule.c | |
parent | 9523c0d84f351a610dc651b234461eb015fa3b82 (diff) | |
download | cpython-git-bb1c543f4a183f5cfdf15aad59f59094d50b37fd.tar.gz |
bpo-46987: Remove _PySys_GetObjectId / _PySys_GetObjectId (GH-31835)
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r-- | Python/sysmodule.c | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c index a97d0341dd..99540b09c1 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -73,29 +73,6 @@ _PySys_GetAttr(PyThreadState *tstate, PyObject *name) } 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) { PyObject *sysdict = interp->sysdict; @@ -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) { |