summaryrefslogtreecommitdiffstats
path: root/Modules/faulthandler.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-11-07 22:07:29 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-11-07 22:07:29 (GMT)
commitbd303c165bc914fc943026ece55f4ebd225614c9 (patch)
tree030e6e557eff5ec98fef23e359498824f21afe4a /Modules/faulthandler.c
parent07e9e380f93e334f8f11d3ff9f42bf7c68b27d3a (diff)
downloadcpython-bd303c165bc914fc943026ece55f4ebd225614c9.zip
cpython-bd303c165bc914fc943026ece55f4ebd225614c9.tar.gz
cpython-bd303c165bc914fc943026ece55f4ebd225614c9.tar.bz2
Issue #19512, #19515: remove shared identifiers, move identifiers where they
are used. Move also _Py_IDENTIFIER() defintions to the top in modified files to remove identifiers duplicated in the same file.
Diffstat (limited to 'Modules/faulthandler.c')
-rw-r--r--Modules/faulthandler.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c
index 315b32d..27b1d54 100644
--- a/Modules/faulthandler.c
+++ b/Modules/faulthandler.c
@@ -26,6 +26,11 @@
(anyway, the length is smaller than 30 characters) */
#define PUTS(fd, str) write(fd, str, (int)strlen(str))
+_Py_IDENTIFIER(enable);
+_Py_IDENTIFIER(fileno);
+_Py_IDENTIFIER(flush);
+_Py_IDENTIFIER(stderr);
+
#ifdef HAVE_SIGACTION
typedef struct sigaction _Py_sighandler_t;
#else
@@ -130,13 +135,11 @@ static PyObject*
faulthandler_get_fileno(PyObject *file, int *p_fd)
{
PyObject *result;
- _Py_IDENTIFIER(fileno);
- _Py_IDENTIFIER(flush);
long fd_long;
int fd;
if (file == NULL || file == Py_None) {
- file = _PySys_GetObjectId(&_PyId_stderr);
+ file = _PySys_GetObjectId(&PyId_stderr);
if (file == NULL) {
PyErr_SetString(PyExc_RuntimeError, "unable to get sys.stderr");
return NULL;
@@ -1047,7 +1050,6 @@ static int
faulthandler_env_options(void)
{
PyObject *xoptions, *key, *module, *res;
- _Py_IDENTIFIER(enable);
char *p;
if (!((p = Py_GETENV("PYTHONFAULTHANDLER")) && *p != '\0')) {