Make these files to compile again under Windows.
authorThomas Heller <theller@ctypes.org>
Tue, 15 Jul 2008 17:14:51 +0000 (17:14 +0000)
committerThomas Heller <theller@ctypes.org>
Tue, 15 Jul 2008 17:14:51 +0000 (17:14 +0000)
Python/pythonrun.c
Python/sysmodule.c

index ad758a6fd973e704ae8c8c3b0949f4617121b321..d13563ffb35064b8f0102062009ba196dce48bf4 100644 (file)
@@ -1340,9 +1340,10 @@ print_exception(PyObject *f, PyObject *value)
                /* Don't do anything else */
        }
        else {
-               assert(PyExceptionClass_Check(type));
                PyObject* moduleName;
-               char* className = PyExceptionClass_Name(type);
+               char* className;
+               assert(PyExceptionClass_Check(type));
+               className = PyExceptionClass_Name(type);
                if (className != NULL) {
                        char *dot = strrchr(className, '.');
                        if (dot != NULL)
index 896b2cd85f3277ef9ddd12b24f95d8be08515636..4017ac2fa8e25be738c0d0c45fe9f364d4f189f7 100644 (file)
@@ -616,6 +616,7 @@ sys_getsizeof(PyObject *self, PyObject *args, PyObject *kwds)
        static PyObject *str__sizeof__, *gc_head_size = NULL;
        static char *kwlist[] = {"object", "default", 0};
        PyObject *o, *dflt = NULL;
+       PyObject *method;
 
        if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O:getsizeof",
                                         kwlist, &o, &dflt))
@@ -639,7 +640,7 @@ sys_getsizeof(PyObject *self, PyObject *args, PyObject *kwds)
        if (PyType_Ready(Py_TYPE(o)) < 0)
                return NULL;
        
-       PyObject *method = _PyType_Lookup(Py_TYPE(o), str__sizeof__);
+       method = _PyType_Lookup(Py_TYPE(o), str__sizeof__);
        if (method == NULL)
                PyErr_Format(PyExc_TypeError,
                             "Type %.100s doesn't define __sizeof__",