[Python-checkins] r46420 - python/branches/sreifschneider-newnewexcept/Objects/exceptions.c

tim.peters python-checkins at python.org
Fri May 26 23:30:35 CEST 2006


Author: tim.peters
Date: Fri May 26 23:30:35 2006
New Revision: 46420

Modified:
   python/branches/sreifschneider-newnewexcept/Objects/exceptions.c
Log:
WindowsError_new():  Fixed some goofy errors.


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 23:30:35 2006
@@ -759,7 +759,7 @@
 static PyObject *
 WindowsError_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
 {
-    PyObject *o_errcode;
+    PyObject *o_errcode = NULL;
     long errcode;
     PyWindowsErrorObject *self;
     long posix_errno;
@@ -771,8 +771,8 @@
     /* Set errno to the POSIX errno, and winerror to the Win32
        error code. */
     errcode = PyInt_AsLong(self->myerrno);
-    if (!errcode == -1 && PyErr_Occurred())
-        return NULL;
+    if (errcode == -1 && PyErr_Occurred())
+        goto failed;
     posix_errno = winerror_to_errno(errcode);
 
     self->winerror = self->myerrno;


More information about the Python-checkins mailing list