summaryrefslogtreecommitdiff
path: root/Python/traceback.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-11-07 23:07:29 +0100
committerVictor Stinner <victor.stinner@gmail.com>2013-11-07 23:07:29 +0100
commit359ed22ea49d63923b451351ebf80decaaa7b79e (patch)
tree315b259308cae6069a685d9926be04cd9c074ad8 /Python/traceback.c
parent0256aab9761d4459c9ceb8fdb11e4fe86f2bdb69 (diff)
downloadcpython-359ed22ea49d63923b451351ebf80decaaa7b79e.tar.gz
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.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/Python/traceback.c b/Python/traceback.c
index b0bed5f780..e9169ce5e0 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)