diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-11-07 22:07:29 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-11-07 22:07:29 (GMT) |
commit | bd303c165bc914fc943026ece55f4ebd225614c9 (patch) | |
tree | 030e6e557eff5ec98fef23e359498824f21afe4a /Python/traceback.c | |
parent | 07e9e380f93e334f8f11d3ff9f42bf7c68b27d3a (diff) | |
download | cpython-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 'Python/traceback.c')
-rw-r--r-- | Python/traceback.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Python/traceback.c b/Python/traceback.c index b0bed5f..e9169ce 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -21,6 +21,11 @@ /* Function from Parser/tokenizer.c */ extern char * PyTokenizer_FindEncodingFilename(int, PyObject *); +_Py_IDENTIFIER(TextIOWrapper); +_Py_IDENTIFIER(close); +_Py_IDENTIFIER(open); +_Py_IDENTIFIER(path); + static PyObject * tb_dir(PyTracebackObject *self) { @@ -152,7 +157,6 @@ _Py_FindSourceFile(PyObject *filename, char* namebuf, size_t namelen, PyObject * const char* filepath; Py_ssize_t len; PyObject* result; - _Py_IDENTIFIER(open); filebytes = PyUnicode_EncodeFSDefault(filename); if (filebytes == NULL) { @@ -169,7 +173,7 @@ _Py_FindSourceFile(PyObject *filename, char* namebuf, size_t namelen, PyObject * tail++; taillen = strlen(tail); - syspath = _PySys_GetObjectId(&_PyId_path); + syspath = _PySys_GetObjectId(&PyId_path); if (syspath == NULL || !PyList_Check(syspath)) goto error; npath = PyList_Size(syspath); @@ -232,9 +236,6 @@ _Py_DisplaySourceLine(PyObject *f, PyObject *filename, int lineno, int indent) char buf[MAXPATHLEN+1]; int kind; void *data; - _Py_IDENTIFIER(close); - _Py_IDENTIFIER(open); - _Py_IDENTIFIER(TextIOWrapper); /* open the file */ if (filename == NULL) |