mirror of
https://github.com/python/cpython.git
synced 2025-10-04 22:20:46 +00:00
[3.6] bpo-31471: Fix assertion failure in subprocess.Popen() on Windows, in case env has a bad keys() method. (GH-3580) (#3584)
(cherry picked from commit 0b3a87ef54
)
This commit is contained in:
parent
20fa05d022
commit
f135f62cfd
3 changed files with 16 additions and 1 deletions
|
@ -723,9 +723,13 @@ getenvironment(PyObject* environment)
|
|||
}
|
||||
|
||||
keys = PyMapping_Keys(environment);
|
||||
if (!keys) {
|
||||
return NULL;
|
||||
}
|
||||
values = PyMapping_Values(environment);
|
||||
if (!keys || !values)
|
||||
if (!values) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
envsize = PySequence_Fast_GET_SIZE(keys);
|
||||
if (PySequence_Fast_GET_SIZE(values) != envsize) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue