changeset: 104785:60b6e820abe5 parent: 104783:9d95510dc203 parent: 104784:db7bcd92cf85 user: Yury Selivanov date: Fri Oct 28 19:01:46 2016 -0400 files: Objects/dictobject.c description: Merge 3.6 (issue #28544) diff -r 9d95510dc203 -r 60b6e820abe5 Include/dictobject.h --- a/Include/dictobject.h Fri Oct 28 18:49:10 2016 -0400 +++ b/Include/dictobject.h Fri Oct 28 19:01:46 2016 -0400 @@ -112,7 +112,7 @@ PyAPI_FUNC(int) _PyDict_HasOnlyStringKeys(PyObject *mp); Py_ssize_t _PyDict_KeysSize(PyDictKeysObject *keys); Py_ssize_t _PyDict_SizeOf(PyDictObject *); -PyAPI_FUNC(PyObject *) _PyDict_Pop(PyDictObject *, PyObject *, PyObject *); +PyAPI_FUNC(PyObject *) _PyDict_Pop(PyObject *, PyObject *, PyObject *); PyObject *_PyDict_FromKeys(PyObject *, PyObject *, PyObject *); #define _PyDict_HasSplitTable(d) ((d)->ma_values != NULL) diff -r 9d95510dc203 -r 60b6e820abe5 Modules/_asynciomodule.c --- a/Modules/_asynciomodule.c Fri Oct 28 18:49:10 2016 -0400 +++ b/Modules/_asynciomodule.c Fri Oct 28 19:01:46 2016 -0400 @@ -21,7 +21,7 @@ /* State of the _asyncio module */ static PyObject *all_tasks; -static PyDictObject *current_tasks; +static PyObject *current_tasks; static PyObject *traceback_extract_stack; static PyObject *asyncio_get_event_loop; static PyObject *asyncio_future_repr_info_func; @@ -1429,11 +1429,11 @@ return NULL; } - res = PyDict_GetItem((PyObject*)current_tasks, loop); + res = PyDict_GetItem(current_tasks, loop); Py_DECREF(loop); } else { - res = PyDict_GetItem((PyObject*)current_tasks, loop); + res = PyDict_GetItem(current_tasks, loop); } if (res == NULL) { @@ -2235,7 +2235,7 @@ PyObject *res; PyObject *ot; - if (PyDict_SetItem((PyObject *)current_tasks, + if (PyDict_SetItem(current_tasks, task->task_loop, (PyObject*)task) == -1) { return NULL; @@ -2385,7 +2385,7 @@ goto fail; } - current_tasks = (PyDictObject *)PyDict_New(); + current_tasks = PyDict_New(); if (current_tasks == NULL) { goto fail; } diff -r 9d95510dc203 -r 60b6e820abe5 Objects/dictobject.c --- a/Objects/dictobject.c Fri Oct 28 18:49:10 2016 -0400 +++ b/Objects/dictobject.c Fri Oct 28 19:01:46 2016 -0400 @@ -1769,13 +1769,17 @@ /* Internal version of dict.pop(). */ PyObject * -_PyDict_Pop(PyDictObject *mp, PyObject *key, PyObject *deflt) +_PyDict_Pop(PyObject *dict, PyObject *key, PyObject *deflt) { Py_hash_t hash; Py_ssize_t ix, hashpos; PyObject *old_value, *old_key; PyDictKeyEntry *ep; PyObject **value_addr; + PyDictObject *mp; + + assert(PyDict_Check(dict)); + mp = (PyDictObject *)dict; if (mp->ma_used == 0) { if (deflt) { @@ -2837,7 +2841,7 @@ if(!PyArg_UnpackTuple(args, "pop", 1, 2, &key, &deflt)) return NULL; - return _PyDict_Pop(mp, key, deflt); + return _PyDict_Pop((PyObject*)mp, key, deflt); } static PyObject *