Mercurial > cpython-lru_cache-weakref
comparison Python/errors.c @ 26601:cc05c2c8660e legacy-trunk
Constify filenames and scripts. Fixes #651362.
| author | Martin v. Löwis <martin@v.loewis.de> |
|---|---|
| date | Wed, 11 Dec 2002 14:04:59 +0000 |
| parents | 2fa559fb6ec5 |
| children | e07b21ea3c45 |
comparison
equal
deleted
inserted
replaced
| 26600:75bfc24fd748 | 26601:cc05c2c8660e |
|---|---|
| 635 } | 635 } |
| 636 | 636 |
| 637 | 637 |
| 638 /* Warning with explicit origin */ | 638 /* Warning with explicit origin */ |
| 639 int | 639 int |
| 640 PyErr_WarnExplicit(PyObject *category, char *message, | 640 PyErr_WarnExplicit(PyObject *category, const char *message, |
| 641 char *filename, int lineno, | 641 const char *filename, int lineno, |
| 642 char *module, PyObject *registry) | 642 const char *module, PyObject *registry) |
| 643 { | 643 { |
| 644 PyObject *mod, *dict, *func = NULL; | 644 PyObject *mod, *dict, *func = NULL; |
| 645 | 645 |
| 646 mod = PyImport_ImportModule("warnings"); | 646 mod = PyImport_ImportModule("warnings"); |
| 647 if (mod != NULL) { | 647 if (mod != NULL) { |
| 677 /* Set file and line information for the current exception. | 677 /* Set file and line information for the current exception. |
| 678 If the exception is not a SyntaxError, also sets additional attributes | 678 If the exception is not a SyntaxError, also sets additional attributes |
| 679 to make printing of exceptions believe it is a syntax error. */ | 679 to make printing of exceptions believe it is a syntax error. */ |
| 680 | 680 |
| 681 void | 681 void |
| 682 PyErr_SyntaxLocation(char *filename, int lineno) | 682 PyErr_SyntaxLocation(const char *filename, int lineno) |
| 683 { | 683 { |
| 684 PyObject *exc, *v, *tb, *tmp; | 684 PyObject *exc, *v, *tb, *tmp; |
| 685 | 685 |
| 686 /* add attributes for the line number and filename for the error */ | 686 /* add attributes for the line number and filename for the error */ |
| 687 PyErr_Fetch(&exc, &v, &tb); | 687 PyErr_Fetch(&exc, &v, &tb); |
| 741 XXX The functionality of this function is quite similar to the | 741 XXX The functionality of this function is quite similar to the |
| 742 functionality in tb_displayline() in traceback.c. | 742 functionality in tb_displayline() in traceback.c. |
| 743 */ | 743 */ |
| 744 | 744 |
| 745 PyObject * | 745 PyObject * |
| 746 PyErr_ProgramText(char *filename, int lineno) | 746 PyErr_ProgramText(const char *filename, int lineno) |
| 747 { | 747 { |
| 748 FILE *fp; | 748 FILE *fp; |
| 749 int i; | 749 int i; |
| 750 char linebuf[1000]; | 750 char linebuf[1000]; |
| 751 | 751 |
