> /* Allocate the result tuple first. Believe it or not, > * this allocation could trigger a garbage collection which > * could resize the dict, which would invalidate the pointer > * (ep) into the dict calculated below, or clear the dict. > * So we have to do this first. > */ > res = PyTuple_New(2); > if (res == NULL) > return NULL; > if (mp->ma_used == 0) { > PyErr_SetString(PyExc_KeyError, > "popitem(): dictionary is empty"); > Py_DECREF(res); > return NULL; > } Good catch -- checked in now! --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4