summaryrefslogtreecommitdiff
path: root/Python/_warnings.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/_warnings.c')
-rw-r--r--Python/_warnings.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/_warnings.c b/Python/_warnings.c
index 602211c02e..9e8b52d353 100644
--- a/Python/_warnings.c
+++ b/Python/_warnings.c
@@ -650,7 +650,7 @@ warn_explicit(PyObject *category, PyObject *message,
text = PyObject_Str(message);
if (text == NULL)
goto cleanup;
- category = (PyObject*)message->ob_type;
+ category = (PyObject*)Py_TYPE(message);
}
else {
text = message;
@@ -906,7 +906,7 @@ get_category(PyObject *message, PyObject *category)
return NULL;
if (rc == 1)
- category = (PyObject*)message->ob_type;
+ category = (PyObject*)Py_TYPE(message);
else if (category == NULL || category == Py_None)
category = PyExc_UserWarning;