diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2024-03-07 09:21:08 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-07 09:21:08 (GMT) |
| commit | 72d3cc94cd8cae1925e7a14f297b06ac6184f916 (patch) | |
| tree | df9d7a5a97a79f97065282dd8e5a89f57ea2e18b /Python/bltinmodule.c | |
| parent | 882fcede83af783a834b759e4643130dc1307ee3 (diff) | |
| download | cpython-72d3cc94cd8cae1925e7a14f297b06ac6184f916.zip cpython-72d3cc94cd8cae1925e7a14f297b06ac6184f916.tar.gz cpython-72d3cc94cd8cae1925e7a14f297b06ac6184f916.tar.bz2 | |
gh-116437: Use new C API PyDict_Pop() to simplify the code (GH-116438)
Diffstat (limited to 'Python/bltinmodule.c')
| -rw-r--r-- | Python/bltinmodule.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index b007496..f66a8c0 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -140,13 +140,10 @@ builtin___build_class__(PyObject *self, PyObject *const *args, Py_ssize_t nargs, goto error; } - if (PyDict_GetItemRef(mkw, &_Py_ID(metaclass), &meta) < 0) { + if (PyDict_Pop(mkw, &_Py_ID(metaclass), &meta) < 0) { goto error; } if (meta != NULL) { - if (PyDict_DelItem(mkw, &_Py_ID(metaclass)) < 0) { - goto error; - } /* metaclass is explicitly given, check if it's indeed a class */ isclass = PyType_Check(meta); } |
