Commit c7f165fe authored by Oren Milman's avatar Oren Milman Committed by Serhiy Storchaka

[2.7] bpo-31471: Fix assertion failure in subprocess.Popen() on Windows, in...

[2.7] bpo-31471: Fix assertion failure in subprocess.Popen() on Windows, in case env has a bad keys() method. (GH-3580) (#3595)
parent a72d15c9
......@@ -341,9 +341,13 @@ getenvironment(PyObject* environment)
envsize = PyMapping_Length(environment);
keys = PyMapping_Keys(environment);
if (!keys) {
return NULL;
}
values = PyMapping_Values(environment);
if (!keys || !values)
if (!values) {
goto error;
}
out = PyString_FromStringAndSize(NULL, 2048);
if (! out)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment