Content-Length: 290451 | pFad | http://github.com/python/cpython/pull/94687/commits/6a236e52fdbecb011d00131210743c617262d5c4

55 gh-94518: [_posixsubprocess] Replace variable validity flags with reserved values by arhadthedev · Pull Request #94687 · python/cpython · GitHub
Skip to content

gh-94518: [_posixsubprocess] Replace variable validity flags with reserved values #94687

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jan 14, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Tighten scope of relevant short lived variables
  • Loading branch information
arhadthedev committed Jul 27, 2022
commit 6a236e52fdbecb011d00131210743c617262d5c4
6 changes: 2 additions & 4 deletions Modules/_posixsubprocess.c
Original file line number Diff line number Diff line change
Expand Up @@ -905,9 +905,6 @@ subprocess_fork_exec(PyObject *module, PyObject *args)

if (groups_list != Py_None) {
#ifdef HAVE_SETGROUPS
Py_ssize_t i;
gid_t gid;

if (!PyList_Check(groups_list)) {
PyErr_SetString(PyExc_TypeError,
"setgroups argument must be a list");
Expand All @@ -933,7 +930,7 @@ subprocess_fork_exec(PyObject *module, PyObject *args)
}
}

for (i = 0; i < num_groups; i++) {
for (Py_ssize_t i = 0; i < num_groups; i++) {
PyObject *elem;
elem = PySequence_GetItem(groups_list, i);
if (!elem)
Expand All @@ -944,6 +941,7 @@ subprocess_fork_exec(PyObject *module, PyObject *args)
Py_DECREF(elem);
goto cleanup;
} else {
gid_t gid;
if (!_Py_Gid_Converter(elem, &gid)) {
Py_DECREF(elem);
PyErr_SetString(PyExc_ValueError, "invalid group id");
Expand Down








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/python/cpython/pull/94687/commits/6a236e52fdbecb011d00131210743c617262d5c4

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy