]> granicus.if.org Git - python/commitdiff
PyErr_Print(): Use PyErr_GivenExceptionMatches() instead of pointer
authorBarry Warsaw <barry@python.org>
Tue, 26 Aug 1997 18:09:48 +0000 (18:09 +0000)
committerBarry Warsaw <barry@python.org>
Tue, 26 Aug 1997 18:09:48 +0000 (18:09 +0000)
compares to test for SystemExit and SyntaxError.

Python/pythonrun.c

index 22cb86bdca9b49975cd8926858417bc59c342e33..c1c5d36c0f107d3ee6db1f077814be55061e372b 100644 (file)
@@ -530,7 +530,7 @@ PyErr_Print()
        PyErr_Fetch(&exception, &v, &tb);
        if (exception == NULL)
                return;
-       if (exception == PyExc_SystemExit) {
+       if (PyErr_GivenExceptionMatches(exception, PyExc_SystemExit)) {
                err = Py_FlushLine();
                fflush(stdout);
                if (v == NULL || v == Py_None)
@@ -555,7 +555,9 @@ PyErr_Print()
                fflush(stdout);
                if (err == 0)
                        err = PyTraceBack_Print(tb, f);
-               if (err == 0 && exception == PyExc_SyntaxError) {
+               if (err == 0 &&
+                   PyErr_GivenExceptionMatches(exception, PyExc_SyntaxError))
+               {
                        PyObject *message;
                        char *filename, *text;
                        int lineno, offset;