summaryrefslogtreecommitdiffstats
path: root/Modules/_posixsubprocess.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2011-10-09 08:38:36 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2011-10-09 08:38:36 (GMT)
commitafe55bba33a20f87a58f940186359237064b428f (patch)
tree66d64a1518d79c3d0e90c0a1d0080cd88e887d99 /Modules/_posixsubprocess.c
parent67df285a3389c7fdb8c7bd301314ac45e17f8074 (diff)
downloadcpython-afe55bba33a20f87a58f940186359237064b428f.zip
cpython-afe55bba33a20f87a58f940186359237064b428f.tar.gz
cpython-afe55bba33a20f87a58f940186359237064b428f.tar.bz2
Add API for static strings, primarily good for identifiers.
Thanks to Konrad Schöbel and Jasper Schulz for helping with the mass-editing.
Diffstat (limited to 'Modules/_posixsubprocess.c')
-rw-r--r--Modules/_posixsubprocess.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/Modules/_posixsubprocess.c b/Modules/_posixsubprocess.c
index bc2f72c..e6a9283 100644
--- a/Modules/_posixsubprocess.c
+++ b/Modules/_posixsubprocess.c
@@ -18,7 +18,9 @@ static long max_fd;
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);
@@ -249,10 +251,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;
@@ -263,7 +268,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;