]> granicus.if.org Git - python/commitdiff
Two more cases of switch(PySequence_Size()) without checking for case -1.
authorNeal Norwitz <nnorwitz@gmail.com>
Wed, 18 Sep 2002 22:37:17 +0000 (22:37 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Wed, 18 Sep 2002 22:37:17 +0000 (22:37 +0000)
(Same problem as last checkin for SF bug 610610)
Need to clear the error and proceed.

Backport candidate

Python/exceptions.c

index 03affdc8431a7e763836bf8a43305c045ff331b0..e4a68803eeb9730181e1a1830f15030401186c52 100644 (file)
@@ -419,6 +419,9 @@ SystemExit__init__(PyObject *self, PyObject *args)
     case 1:
         code = PySequence_GetItem(args, 0);
         break;
+    case -1:
+        PyErr_Clear();
+        /* Fall through */
     default:
         Py_INCREF(args);
         code = args;
@@ -522,6 +525,10 @@ EnvironmentError__init__(PyObject *self, PyObject *args)
            goto finally;
        }
        break;
+
+    case -1:
+       PyErr_Clear();
+       break;
     }
 
     Py_INCREF(Py_None);