bpo-36814: ensure os.posix_spawn() handles None (GH-13144)
Fix an issue where os.posix_spawn() would incorrectly raise a TypeError
when file_actions is None.
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 221f710..aa77094 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -5465,7 +5465,7 @@
goto exit;
}
- if (file_actions != NULL) {
+ if (file_actions != NULL && file_actions != Py_None) {
/* There is a bug in old versions of glibc that makes some of the
* helper functions for manipulating file actions not copy the provided
* buffers. The problem is that posix_spawn_file_actions_addopen does not