diff options
Diffstat (limited to 'Python/_warnings.c')
-rw-r--r-- | Python/_warnings.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Python/_warnings.c b/Python/_warnings.c index b8585d2047..602211c02e 100644 --- a/Python/_warnings.c +++ b/Python/_warnings.c @@ -24,6 +24,8 @@ typedef struct _warnings_runtime_state WarningsState; /* Forward declaration of the _warnings module definition. */ static struct PyModuleDef warningsmodule; +_Py_IDENTIFIER(__name__); + /* Given a module object, get its per-module state. */ static WarningsState * _Warnings_GetState() @@ -484,7 +486,6 @@ show_warning(PyObject *filename, int lineno, PyObject *text, PyObject *f_stderr; PyObject *name; char lineno_str[128]; - _Py_IDENTIFIER(__name__); PyOS_snprintf(lineno_str, sizeof(lineno_str), ":%d: ", lineno); @@ -818,7 +819,6 @@ setup_context(Py_ssize_t stack_level, PyObject **filename, int *lineno, PyObject **module, PyObject **registry) { _Py_IDENTIFIER(__warningregistry__); - _Py_IDENTIFIER(__name__); PyObject *globals; /* Setup globals, filename and lineno. */ @@ -969,7 +969,6 @@ get_source_line(PyObject *module_globals, int lineno) { _Py_IDENTIFIER(get_source); _Py_IDENTIFIER(__loader__); - _Py_IDENTIFIER(__name__); PyObject *loader; PyObject *module_name; PyObject *get_source; |