Skip to content

Commit 80918db

Browse files
committed
Fix style issues and merge big comment blocks
1 parent 6db5f32 commit 80918db

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

Modules/posixmodule.c

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5225,16 +5225,11 @@ parse_file_actions(PyObject *file_actions,
52255225
{
52265226
goto fail;
52275227
}
5228-
int error = PyList_Append(temp_buffer, path);
5229-
if (error) {
5228+
if (PyList_Append(temp_buffer, path)) {
52305229
goto fail;
52315230
}
52325231
errno = posix_spawn_file_actions_addopen(file_actionsp,
52335232
fd, PyBytes_AS_STRING(path), oflag, (mode_t)mode);
5234-
/* addopen copies the value except for some old versions of
5235-
* glibc (<2.20). The usage of temp_buffer is a workaround
5236-
* to keep this temporary objects alive until posix_spawn
5237-
* gets called.*/
52385233
Py_DECREF(path);
52395234
if (errno) {
52405235
posix_error();
@@ -5359,16 +5354,17 @@ os_posix_spawn_impl(PyObject *module, path_t *path, PyObject *argv,
53595354
}
53605355

53615356
if (file_actions != Py_None) {
5362-
53635357
/* There is a bug in old versions of glibc that makes some of the
53645358
* helper functions for manipulating file actions not copy the provided
53655359
* buffers. The use of `temp_buffer` here is a workaround that keeps the
53665360
* python objects that own the buffers alive until posix_spawn gets called.
5361+
* posix_spawn_file_actions_addopen copies the value of **path** except for
5362+
* some old * versions of * glibc (<2.20). The usage of temp_buffer is
5363+
* a workaround * to keep this temporary objects alive until posix_spawn
5364+
* gets called.
53675365
* Check https://bugs.python.org/issue33630 and
5368-
* https://sourceware.org/bugzilla/show_bug.cgi?id=17048 for more info. */
5369-
5366+
* https://sourceware.org/bugzilla/show_bug.cgi?id=17048 for more info.*/
53705367
temp_buffer = PyList_New(0);
5371-
53725368
if (!temp_buffer) {
53735369
goto exit;
53745370
}
@@ -5399,9 +5395,7 @@ os_posix_spawn_impl(PyObject *module, path_t *path, PyObject *argv,
53995395
if (argvlist) {
54005396
free_string_array(argvlist, argc);
54015397
}
5402-
54035398
Py_XDECREF(temp_buffer);
5404-
54055399
return result;
54065400
}
54075401
#endif /* HAVE_POSIX_SPAWN */

0 commit comments

Comments
 (0)