Mercurial > cpython-lru_cache-weakref
diff Python/_warnings.c @ 86999:01c4a0af73cf
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.
| author | Victor Stinner <victor.stinner@gmail.com> |
|---|---|
| date | Thu, 07 Nov 2013 23:07:29 +0100 |
| parents | 954167ce92a3 |
| children |
line wrap: on
line diff
--- a/Python/_warnings.c Thu Nov 07 22:22:39 2013 +0100 +++ b/Python/_warnings.c Thu Nov 07 23:07:29 2013 +0100 @@ -13,6 +13,8 @@ static PyObject *_once_registry; /* Dict */ static PyObject *_default_action; /* String */ +_Py_IDENTIFIER(argv); +_Py_IDENTIFIER(stderr); static int check_matched(PyObject *obj, PyObject *arg) @@ -265,7 +267,7 @@ if (name == NULL) /* XXX Can an object lack a '__name__' attribute? */ goto error; - f_stderr = _PySys_GetObjectId(&_PyId_stderr); + f_stderr = _PySys_GetObjectId(&PyId_stderr); if (f_stderr == NULL) { fprintf(stderr, "lost sys.stderr\n"); goto error; @@ -562,7 +564,7 @@ else { *filename = NULL; if (*module != Py_None && PyUnicode_CompareWithASCIIString(*module, "__main__") == 0) { - PyObject *argv = _PySys_GetObjectId(&_PyId_argv); + PyObject *argv = _PySys_GetObjectId(&PyId_argv); /* PyList_Check() is needed because sys.argv is set to None during Python finalization */ if (argv != NULL && PyList_Check(argv) && PyList_Size(argv) > 0) {
