summaryrefslogtreecommitdiffstats
path: root/Modules/_posixsubprocess.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_posixsubprocess.c')
-rw-r--r--Modules/_posixsubprocess.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/Modules/_posixsubprocess.c b/Modules/_posixsubprocess.c
index 19ca31f..b7b120b 100644
--- a/Modules/_posixsubprocess.c
+++ b/Modules/_posixsubprocess.c
@@ -47,7 +47,9 @@ static int
_enable_gc(PyObject *gc_module)
{
PyObject *result;
- result = PyObject_CallMethod(gc_module, "enable", NULL);
+ _Py_IDENTIFIER(enable);
+
+ result = _PyObject_CallMethodId(gc_module, &PyId_enable, NULL);
if (result == NULL)
return 1;
Py_DECREF(result);
@@ -78,7 +80,7 @@ _pos_int_from_ascii(char *name)
* that properly supports /dev/fd.
*/
static int
-_is_fdescfs_mounted_on_dev_fd()
+_is_fdescfs_mounted_on_dev_fd(void)
{
struct stat dev_stat;
struct stat dev_fd_stat;
@@ -506,7 +508,7 @@ static PyObject *
subprocess_fork_exec(PyObject* self, PyObject *args)
{
PyObject *gc_module = NULL;
- PyObject *executable_list, *py_close_fds, *py_fds_to_keep;
+ PyObject *executable_list, *py_fds_to_keep;
PyObject *env_list, *preexec_fn;
PyObject *process_args, *converted_args = NULL, *fast_args = NULL;
PyObject *preexec_fn_args_tuple = NULL;
@@ -521,17 +523,14 @@ subprocess_fork_exec(PyObject* self, PyObject *args)
Py_ssize_t arg_num;
if (!PyArg_ParseTuple(
- args, "OOOOOOiiiiiiiiiiO:fork_exec",
- &process_args, &executable_list, &py_close_fds, &py_fds_to_keep,
+ args, "OOpOOOiiiiiiiiiiO:fork_exec",
+ &process_args, &executable_list, &close_fds, &py_fds_to_keep,
&cwd_obj, &env_list,
&p2cread, &p2cwrite, &c2pread, &c2pwrite,
&errread, &errwrite, &errpipe_read, &errpipe_write,
&restore_signals, &call_setsid, &preexec_fn))
return NULL;
- close_fds = PyObject_IsTrue(py_close_fds);
- if (close_fds < 0)
- return NULL;
if (close_fds && errpipe_write < 3) { /* precondition */
PyErr_SetString(PyExc_ValueError, "errpipe_write must be >= 3");
return NULL;
@@ -548,10 +547,13 @@ subprocess_fork_exec(PyObject* self, PyObject *args)
/* We need to call gc.disable() when we'll be calling preexec_fn */
if (preexec_fn != Py_None) {
PyObject *result;
+ _Py_IDENTIFIER(isenabled);
+ _Py_IDENTIFIER(disable);
+
gc_module = PyImport_ImportModule("gc");
if (gc_module == NULL)
return NULL;
- result = PyObject_CallMethod(gc_module, "isenabled", NULL);
+ result = _PyObject_CallMethodId(gc_module, &PyId_isenabled, NULL);
if (result == NULL) {
Py_DECREF(gc_module);
return NULL;
@@ -562,7 +564,7 @@ subprocess_fork_exec(PyObject* self, PyObject *args)
Py_DECREF(gc_module);
return NULL;
}
- result = PyObject_CallMethod(gc_module, "disable", NULL);
+ result = _PyObject_CallMethodId(gc_module, &PyId_disable, NULL);
if (result == NULL) {
Py_DECREF(gc_module);
return NULL;