gh-123858: Improve Doc: SyntaxWarning is emitted during bytecode generation (gh-122844)

---------

Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
This commit is contained in:
Hang 2025-08-29 21:29:59 +08:00 committed by GitHub
parent 88bfe4c47b
commit 5f7906715a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View file

@ -897,6 +897,9 @@ The following exceptions are used as warning categories; see the
Base class for warnings about dubious syntax.
This warning is typically emitted when compiling Python source code, and usually won't be reported
when running already compiled code.
.. exception:: RuntimeWarning

View file

@ -80,7 +80,9 @@ The following warnings category classes are currently defined:
| | unless triggered by code in ``__main__``). |
+----------------------------------+-----------------------------------------------+
| :exc:`SyntaxWarning` | Base category for warnings about dubious |
| | syntactic features. |
| | syntactic features (typically emitted when |
| | compiling Python source code, and hence |
| | may not be suppressed by runtime filters) |
+----------------------------------+-----------------------------------------------+
| :exc:`RuntimeWarning` | Base category for warnings about dubious |
| | runtime features. |