summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorNikita Sobolev <mail@sobolevn.me>2022-09-15 09:33:13 (GMT)
committerGitHub <noreply@github.com>2022-09-15 09:33:13 (GMT)
commite37ac5fbb6de593521cf218aa05bc58a45c5a7c9 (patch)
treec4a326c8def6bf08986f620dae1d5b9bed3b40bc /Python/ceval.c
parent8e9a37dde44c9fa0b961cb2db5dc8266e1f85d11 (diff)
downloadcpython-e37ac5fbb6de593521cf218aa05bc58a45c5a7c9.zip
cpython-e37ac5fbb6de593521cf218aa05bc58a45c5a7c9.tar.gz
cpython-e37ac5fbb6de593521cf218aa05bc58a45c5a7c9.tar.bz2
gh-96751: Remove dead code from `CALL_FUNCTION_EX` opcode (GH-96752)
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 1cf7246..b61cc08 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -4716,19 +4716,8 @@ handle_eval_breaker:
PyObject *func, *callargs, *kwargs = NULL, *result;
if (oparg & 0x01) {
kwargs = POP();
- if (!PyDict_CheckExact(kwargs)) {
- PyObject *d = PyDict_New();
- if (d == NULL)
- goto error;
- if (_PyDict_MergeEx(d, kwargs, 2) < 0) {
- Py_DECREF(d);
- format_kwargs_error(tstate, SECOND(), kwargs);
- Py_DECREF(kwargs);
- goto error;
- }
- Py_DECREF(kwargs);
- kwargs = d;
- }
+ // DICT_MERGE is called before this opcode if there are kwargs.
+ // It converts all dict subtypes in kwargs into regular dicts.
assert(PyDict_CheckExact(kwargs));
}
callargs = POP();