bpo-31285: Fix an assertion failure and a SystemError in warnings.warn_explicit. (#3219)

This commit is contained in:
Oren Milman 2017-09-24 21:27:12 +03:00 committed by Serhiy Storchaka
parent 8337239d79
commit 91fb0afe18
3 changed files with 40 additions and 3 deletions

View file

@ -893,9 +893,7 @@ warnings_warn_explicit(PyObject *self, PyObject *args, PyObject *kwds)
}
/* Split the source into lines. */
source_list = PyObject_CallMethodObjArgs(source,
PyId_splitlines.object,
NULL);
source_list = PyUnicode_Splitlines(source, 0);
Py_DECREF(source);
if (!source_list)
return NULL;