Skip to content

Commit 41290e1

Browse files
committed
[skip ci] Minor edits.
1 parent 62cc745 commit 41290e1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/advanced/exceptions.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -329,22 +329,22 @@ Any Python error must be thrown or cleared, or Python/pybind11 will be left in
329329
an invalid state.
330330

331331
Handling warnings from the Python C API
332-
=====================================
332+
=======================================
333333

334-
Wrappers for handling Python warnings are implemented in ``pybind11/warnings.h``,
335-
which means that ``#include`` must be added explicitly (in other words, it is not
336-
transitively included with ``pybind11/pybind11.h``).
334+
Wrappers for handling Python warnings are provided in ``pybind11/warnings.h``.
335+
This header must be included explicitly; it is not transitively included via
336+
``pybind11/pybind11.h``.
337337

338338
Warnings can be raised with the ``warn`` function:
339339

340340
.. code-block:: cpp
341341
342-
py::warnings::warn("This is warning!", PyExc_Warning);
342+
py::warnings::warn("This is a warning!", PyExc_Warning);
343343
344-
// Optionally, `stack_level` can be specified.
344+
// Optionally, a `stack_level` can be specified.
345345
py::warnings::warn("Another one!", PyExc_DeprecationWarning, 3);
346346
347-
New warning types can be registered on the module level with ``new_warning_type``:
347+
New warning types can be registered at the module level using ``new_warning_type``:
348348

349349
.. code-block:: cpp
350350

0 commit comments

Comments
 (0)