Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
684ef2c8
Commit
684ef2c8
authored
Oct 28, 2016
by
Yury Selivanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #28544: Pass `PyObject*` to _PyDict_Pop, not `PyDictObject*`
parent
833c626e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
8 deletions
+12
-8
Include/dictobject.h
Include/dictobject.h
+1
-1
Modules/_asynciomodule.c
Modules/_asynciomodule.c
+5
-5
Objects/dictobject.c
Objects/dictobject.c
+6
-2
No files found.
Include/dictobject.h
View file @
684ef2c8
...
...
@@ -112,7 +112,7 @@ PyAPI_FUNC(void) _PyDict_MaybeUntrack(PyObject *mp);
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
(
Py
Dict
Object
*
,
PyObject
*
,
PyObject
*
);
PyAPI_FUNC
(
PyObject
*
)
_PyDict_Pop
(
PyObject
*
,
PyObject
*
,
PyObject
*
);
PyObject
*
_PyDict_FromKeys
(
PyObject
*
,
PyObject
*
,
PyObject
*
);
#define _PyDict_HasSplitTable(d) ((d)->ma_values != NULL)
...
...
Modules/_asynciomodule.c
View file @
684ef2c8
...
...
@@ -21,7 +21,7 @@ _Py_IDENTIFIER(_wakeup);
/* State of the _asyncio module */
static
PyObject
*
all_tasks
;
static
Py
Dict
Object
*
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 @@ _asyncio_Task_current_task_impl(PyTypeObject *type, PyObject *loop)
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 @@ task_step(TaskObj *task, PyObject *exc)
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 @@ module_init(void)
goto
fail
;
}
current_tasks
=
(
PyDictObject
*
)
PyDict_New
();
current_tasks
=
PyDict_New
();
if
(
current_tasks
==
NULL
)
{
goto
fail
;
}
...
...
Objects/dictobject.c
View file @
684ef2c8
...
...
@@ -1768,13 +1768,17 @@ PyDict_Next(PyObject *op, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue)
/* Internal version of dict.pop(). */
PyObject
*
_PyDict_Pop
(
Py
DictObject
*
mp
,
PyObject
*
key
,
PyObject
*
deflt
)
_PyDict_Pop
(
Py
Object
*
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
)
{
...
...
@@ -2836,7 +2840,7 @@ dict_pop(PyDictObject *mp, PyObject *args)
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
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment