diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2011-10-09 08:38:36 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2011-10-09 08:38:36 (GMT) |
commit | afe55bba33a20f87a58f940186359237064b428f (patch) | |
tree | 66d64a1518d79c3d0e90c0a1d0080cd88e887d99 /Modules/faulthandler.c | |
parent | 67df285a3389c7fdb8c7bd301314ac45e17f8074 (diff) | |
download | cpython-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/faulthandler.c')
-rw-r--r-- | Modules/faulthandler.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c index 06f7f2e..11d5340 100644 --- a/Modules/faulthandler.c +++ b/Modules/faulthandler.c @@ -146,6 +146,8 @@ static PyObject* faulthandler_get_fileno(PyObject *file, int *p_fd) { PyObject *result; + _Py_identifier(fileno); + _Py_identifier(flush); long fd_long; int fd; @@ -157,7 +159,7 @@ faulthandler_get_fileno(PyObject *file, int *p_fd) } } - result = PyObject_CallMethod(file, "fileno", ""); + result = _PyObject_CallMethodId(file, &PyId_fileno, ""); if (result == NULL) return NULL; @@ -175,7 +177,7 @@ faulthandler_get_fileno(PyObject *file, int *p_fd) return NULL; } - result = PyObject_CallMethod(file, "flush", ""); + result = _PyObject_CallMethodId(file, &PyId_flush, ""); if (result != NULL) Py_DECREF(result); else { @@ -1197,6 +1199,7 @@ static int faulthandler_env_options(void) { PyObject *xoptions, *key, *module, *res; + _Py_identifier(enable); if (!Py_GETENV("PYTHONFAULTHANDLER")) { int has_key; @@ -1219,7 +1222,7 @@ faulthandler_env_options(void) if (module == NULL) { return -1; } - res = PyObject_CallMethod(module, "enable", ""); + res = _PyObject_CallMethodId(module, &PyId_enable, ""); Py_DECREF(module); if (res == NULL) return -1; |