File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -170,6 +170,10 @@ Object Protocol
170170 Python expression ``str(o) ``. Called by the :func: `str ` built-in function
171171 and, therefore, by the :func: `print ` function.
172172
173+ .. versionchanged :: 3.4
174+ This function now includes a debug assertion that ensures it does not
175+ silently discard an active exception.
176+
173177.. c :function :: PyObject* PyObject_Bytes (PyObject *o)
174178
175179 .. index :: builtin: bytes
Original file line number Diff line number Diff line change @@ -1708,6 +1708,13 @@ Changes in the Python API
17081708Changes in the C API
17091709--------------------
17101710
1711+ * :c:func: `PyObject_Str ` now includes a debug assertion that ensures it will
1712+ no longer silently discard currently active exceptions. In cases where
1713+ discarding the active exception is expected and desired (for example,
1714+ because it has already been saved locally with :c:func: `PyErr_Fetch `), an
1715+ explicit :c:func: `PyErr_Clear ` call will be needed to avoid triggering the
1716+ assertion.
1717+
17111718* :c:func: `PyErr_SetImportError ` now sets :exc: `TypeError ` when its **msg **
17121719 argument is not set. Previously only ``NULL `` was returned with no exception
17131720 set.
You can’t perform that action at this time.
0 commit comments