mirror of
https://github.com/python/cpython.git
synced 2025-10-03 21:55:41 +00:00
[3.6] bpo-31285: Fix an assertion failure and a SystemError in warnings.warn_explicit. (GH-3219) (#3775)
(cherry picked from commit 91fb0afe18
)
This commit is contained in:
parent
bdb215b18a
commit
90fe25a051
3 changed files with 40 additions and 3 deletions
|
@ -900,9 +900,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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue