@@ -5225,16 +5225,11 @@ parse_file_actions(PyObject *file_actions,
5225
5225
{
5226
5226
goto fail ;
5227
5227
}
5228
- int error = PyList_Append (temp_buffer , path );
5229
- if (error ) {
5228
+ if (PyList_Append (temp_buffer , path )) {
5230
5229
goto fail ;
5231
5230
}
5232
5231
errno = posix_spawn_file_actions_addopen (file_actionsp ,
5233
5232
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.*/
5238
5233
Py_DECREF (path );
5239
5234
if (errno ) {
5240
5235
posix_error ();
@@ -5359,16 +5354,17 @@ os_posix_spawn_impl(PyObject *module, path_t *path, PyObject *argv,
5359
5354
}
5360
5355
5361
5356
if (file_actions != Py_None ) {
5362
-
5363
5357
/* There is a bug in old versions of glibc that makes some of the
5364
5358
* helper functions for manipulating file actions not copy the provided
5365
5359
* buffers. The use of `temp_buffer` here is a workaround that keeps the
5366
5360
* 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.
5367
5365
* 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.*/
5370
5367
temp_buffer = PyList_New (0 );
5371
-
5372
5368
if (!temp_buffer ) {
5373
5369
goto exit ;
5374
5370
}
@@ -5399,9 +5395,7 @@ os_posix_spawn_impl(PyObject *module, path_t *path, PyObject *argv,
5399
5395
if (argvlist ) {
5400
5396
free_string_array (argvlist , argc );
5401
5397
}
5402
-
5403
5398
Py_XDECREF (temp_buffer );
5404
-
5405
5399
return result ;
5406
5400
}
5407
5401
#endif /* HAVE_POSIX_SPAWN */
0 commit comments