Mercurial > cpython-lru_cache-weakref
diff Python/ceval.c @ 10363:4daab7a9f566 legacy-trunk
Always test for an error return (usually NULL or -1) without setting
an exception.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Tue, 09 Mar 1999 16:16:45 +0000 |
| parents | 877d23bd5bdc |
| children | d834ecdf8c26 |
line wrap: on
line diff
--- a/Python/ceval.c Tue Mar 09 16:07:23 1999 +0000 +++ b/Python/ceval.c Tue Mar 09 16:16:45 1999 +0000 @@ -1723,6 +1723,7 @@ if (why == WHY_NOT) { if (err == 0 && x != NULL) { #ifdef CHECKEXC + /* This check is expensive! */ if (PyErr_Occurred()) fprintf(stderr, "XXX undetected error\n"); @@ -1735,18 +1736,18 @@ err = 0; } -#ifdef CHECKEXC /* Double-check exception status */ if (why == WHY_EXCEPTION || why == WHY_RERAISE) { if (!PyErr_Occurred()) { - fprintf(stderr, "XXX ghost error\n"); PyErr_SetString(PyExc_SystemError, - "ghost error"); + "error return without exception set"); why = WHY_EXCEPTION; } } +#ifdef CHECKEXC else { + /* This check is expensive! */ if (PyErr_Occurred()) { fprintf(stderr, "XXX undetected error (why=%d)\n",
