mirror of
https://github.com/python/cpython.git
synced 2025-11-13 07:26:31 +00:00
Note the new debug assertion in PyObject_Str
This commit is contained in:
parent
d979e4335d
commit
3d7b3641d3
2 changed files with 11 additions and 0 deletions
|
|
@ -170,6 +170,10 @@ Object Protocol
|
||||||
Python expression ``str(o)``. Called by the :func:`str` built-in function
|
Python expression ``str(o)``. Called by the :func:`str` built-in function
|
||||||
and, therefore, by the :func:`print` function.
|
and, therefore, by the :func:`print` function.
|
||||||
|
|
||||||
|
.. versionchanged:: 3.4
|
||||||
|
This function now includes a debug assertion that ensures it does not
|
||||||
|
silently discard an active exception.
|
||||||
|
|
||||||
.. c:function:: PyObject* PyObject_Bytes(PyObject *o)
|
.. c:function:: PyObject* PyObject_Bytes(PyObject *o)
|
||||||
|
|
||||||
.. index:: builtin: bytes
|
.. index:: builtin: bytes
|
||||||
|
|
|
||||||
|
|
@ -1708,6 +1708,13 @@ Changes in the Python API
|
||||||
Changes in the C API
|
Changes in the C API
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
|
* :c:func:`PyObject_Str` now includes a debug assertion that ensures it will
|
||||||
|
no longer silently discard currently active exceptions. In cases where
|
||||||
|
discarding the active exception is expected and desired (for example,
|
||||||
|
because it has already been saved locally with :c:func:`PyErr_Fetch`), an
|
||||||
|
explicit :c:func:`PyErr_Clear` call will be needed to avoid triggering the
|
||||||
|
assertion.
|
||||||
|
|
||||||
* :c:func:`PyErr_SetImportError` now sets :exc:`TypeError` when its **msg**
|
* :c:func:`PyErr_SetImportError` now sets :exc:`TypeError` when its **msg**
|
||||||
argument is not set. Previously only ``NULL`` was returned with no exception
|
argument is not set. Previously only ``NULL`` was returned with no exception
|
||||||
set.
|
set.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue