We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
_PyEval_GetFrameLocals
ceval.c
1 parent 1506d5a commit a8e5fedCopy full SHA for a8e5fed
Python/ceval.c
@@ -2496,17 +2496,21 @@ _PyEval_GetFrameLocals(void)
2496
2497
if (PyFrameLocalsProxy_Check(locals)) {
2498
PyObject* ret = PyDict_New();
2499
- if (PyDict_Update(ret, locals)) {
+ if (ret == NULL) {
2500
+ Py_DECREF(locals);
2501
+ return NULL;
2502
+ }
2503
+ if (PyDict_Update(ret, locals) < 0) {
2504
Py_DECREF(ret);
2505
2506
return NULL;
2507
}
2508
Py_DECREF(locals);
2509
return ret;
- } else if (PyMapping_Check(locals)) {
- return locals;
2510
2511
- return NULL;
2512
+ assert(PyMapping_Check(locals));
2513
+ return locals;
2514
2515
2516
PyObject *
0 commit comments