@@ -5186,6 +5186,16 @@ os_spawnv_impl(PyObject *module, int mode, PyObject *path, PyObject *argv)
51865186 "spawnv() arg 2 must be a tuple or list" );
51875187 return NULL ;
51885188 }
5189+ #ifdef MS_WINDOWS
5190+ /* Avoid changing behavior in maintenance release, but
5191+ the previous Windows behavior was to crash, so this
5192+ is a "compatible" improvement. */
5193+ if (argc == 0 ) {
5194+ PyErr_SetString (PyExc_ValueError ,
5195+ "spawnv() arg 2 cannot be empty" );
5196+ return NULL ;
5197+ }
5198+ #endif
51895199
51905200 argvlist = PyMem_NEW (char * , argc + 1 );
51915201 if (argvlist == NULL ) {
@@ -5207,7 +5217,9 @@ os_spawnv_impl(PyObject *module, int mode, PyObject *path, PyObject *argv)
52075217 mode = _P_OVERLAY ;
52085218
52095219 Py_BEGIN_ALLOW_THREADS
5220+ _Py_BEGIN_SUPPRESS_IPH
52105221 spawnval = _spawnv (mode , path_char , argvlist );
5222+ _Py_END_SUPPRESS_IPH
52115223 Py_END_ALLOW_THREADS
52125224
52135225 free_string_array (argvlist , argc );
@@ -5297,7 +5309,9 @@ os_spawnve_impl(PyObject *module, int mode, PyObject *path, PyObject *argv,
52975309 mode = _P_OVERLAY ;
52985310
52995311 Py_BEGIN_ALLOW_THREADS
5312+ _Py_BEGIN_SUPPRESS_IPH
53005313 spawnval = _spawnve (mode , path_char , argvlist , envlist );
5314+ _Py_END_SUPPRESS_IPH
53015315 Py_END_ALLOW_THREADS
53025316
53035317 if (spawnval == -1 )
@@ -7022,7 +7036,9 @@ os_waitpid_impl(PyObject *module, Py_intptr_t pid, int options)
70227036
70237037 do {
70247038 Py_BEGIN_ALLOW_THREADS
7039+ _Py_BEGIN_SUPPRESS_IPH
70257040 res = _cwait (& status , pid , options );
7041+ _Py_END_SUPPRESS_IPH
70267042 Py_END_ALLOW_THREADS
70277043 } while (res < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals ()));
70287044 if (res < 0 )
0 commit comments