Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d88ddfa

Browse files
author
Thomas Heller
committed
Make these files to compile again under Windows.
1 parent 0d755b4 commit d88ddfa

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

Python/pythonrun.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,9 +1340,10 @@ print_exception(PyObject *f, PyObject *value)
13401340
/* Don't do anything else */
13411341
}
13421342
else {
1343-
assert(PyExceptionClass_Check(type));
13441343
PyObject* moduleName;
1345-
char* className = PyExceptionClass_Name(type);
1344+
char* className;
1345+
assert(PyExceptionClass_Check(type));
1346+
className = PyExceptionClass_Name(type);
13461347
if (className != NULL) {
13471348
char *dot = strrchr(className, '.');
13481349
if (dot != NULL)

Python/sysmodule.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,7 @@ sys_getsizeof(PyObject *self, PyObject *args, PyObject *kwds)
616616
static PyObject *str__sizeof__, *gc_head_size = NULL;
617617
static char *kwlist[] = {"object", "default", 0};
618618
PyObject *o, *dflt = NULL;
619+
PyObject *method;
619620

620621
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O:getsizeof",
621622
kwlist, &o, &dflt))
@@ -639,7 +640,7 @@ sys_getsizeof(PyObject *self, PyObject *args, PyObject *kwds)
639640
if (PyType_Ready(Py_TYPE(o)) < 0)
640641
return NULL;
641642

642-
PyObject *method = _PyType_Lookup(Py_TYPE(o), str__sizeof__);
643+
method = _PyType_Lookup(Py_TYPE(o), str__sizeof__);
643644
if (method == NULL)
644645
PyErr_Format(PyExc_TypeError,
645646
"Type %.100s doesn't define __sizeof__",

0 commit comments

Comments
 (0)