mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
bpo-31471: Fix assertion failure in subprocess.Popen() on Windows, in case env has a bad keys() method. (#3580)
This commit is contained in:
parent
f350a268a7
commit
0b3a87ef54
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