[Python-checkins] r46310 - in python/branches/sreifschneider-newnewexcept: Lib/test/test_exceptions.py Objects/exceptions.c

richard.jones python-checkins at python.org
Fri May 26 14:34:20 CEST 2006


Author: richard.jones
Date: Fri May 26 14:34:18 2006
New Revision: 46310

Modified:
   python/branches/sreifschneider-newnewexcept/Lib/test/test_exceptions.py
   python/branches/sreifschneider-newnewexcept/Objects/exceptions.c
Log:
fix

Modified: python/branches/sreifschneider-newnewexcept/Lib/test/test_exceptions.py
==============================================================================
--- python/branches/sreifschneider-newnewexcept/Lib/test/test_exceptions.py	(original)
+++ python/branches/sreifschneider-newnewexcept/Lib/test/test_exceptions.py	Fri May 26 14:34:18 2006
@@ -25,7 +25,7 @@
         raise exc("spam")
     except exc, err:
         buf = str(err)
-    print buf
+#    print buf
 
 def r(thing):
     test_raise_catch(thing)
@@ -269,6 +269,7 @@
 
 for args in exceptionList:
     expected = args[-1]
+    print args
     try:
         if len(args) == 2: raise args[0]
         else: raise apply(args[0], args[1])

Modified: python/branches/sreifschneider-newnewexcept/Objects/exceptions.c
==============================================================================
--- python/branches/sreifschneider-newnewexcept/Objects/exceptions.c	(original)
+++ python/branches/sreifschneider-newnewexcept/Objects/exceptions.c	Fri May 26 14:34:18 2006
@@ -415,7 +415,7 @@
 _EnvironmentError_init(EnvironmentErrorObject *self, PyObject *args,
     PyObject *kwds)
 {
-    PyObject *myerrno, *strerror, *filename;
+    PyObject *myerrno = NULL, *strerror = NULL, *filename = NULL;
     PyObject *subslice = NULL;
 
     if (PySequence_Length(args) <= 1) {
@@ -425,7 +425,6 @@
     if (!PyArg_ParseTuple(args, "OO|O", &myerrno, &strerror, &filename)) {
         return -1;
     }
-
     Py_DECREF(self->myerrno);       /* replacing */
     self->myerrno = myerrno;
     Py_INCREF(self->myerrno);
@@ -476,7 +475,8 @@
 EnvironmentError_init(EnvironmentErrorObject *self, PyObject *args,
     PyObject *kwds)
 {
-    if (_BaseException_init(self, args, kwds) == -1) return -1;
+    if (_BaseException_init((BaseExceptionObject *)self, args, kwds) == -1)
+        return -1;
     return _EnvironmentError_init(self, args, kwds);
 }
 
@@ -835,7 +835,8 @@
 static int
 SyntaxError_init(SyntaxErrorObject *self, PyObject *args, PyObject *kwds)
 {
-    if (_BaseException_init(self, args, kwds) == -1) return -1;
+    if (_BaseException_init((BaseExceptionObject *)self, args, kwds) == -1)
+        return -1;
     return _SyntaxError_init(self, args, kwds);
 }
 
@@ -1374,7 +1375,8 @@
 static int
 UnicodeEncodeError_init(PyObject *self, PyObject *args, PyObject *kwds)
 {
-    if (_BaseException_init(self, args, kwds) == -1) return -1;
+    if (_BaseException_init((BaseExceptionObject *)self, args, kwds) == -1)
+        return -1;
     return UnicodeError_init((UnicodeErrorObject *)self, args, kwds, &PyUnicode_Type);
 }
 
@@ -1451,7 +1453,8 @@
 static int
 UnicodeDecodeError_init(PyObject *self, PyObject *args, PyObject *kwds)
 {
-    if (_BaseException_init(self, args, kwds) == -1) return -1;
+    if (_BaseException_init((BaseExceptionObject *)self, args, kwds) == -1)
+        return -1;
     return UnicodeError_init((UnicodeErrorObject *)self, args, kwds, &PyString_Type);
 }
 
@@ -1562,7 +1565,8 @@
 static int
 UnicodeTranslateError_init(UnicodeErrorObject *self, PyObject *args, PyObject *kwds)
 {
-    if (_BaseException_init(self, args, kwds) == -1) return -1;
+    if (_BaseException_init((BaseExceptionObject *)self, args, kwds) == -1)
+        return -1;
 
     if (!PyArg_ParseTuple(args, "O!O!O!O!",
         &PyUnicode_Type, &self->object,


More information about the Python-checkins mailing list