From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Fri, 29 Aug 2025 21:13:09 +0000 (+0200) Subject: [3.14] gh-123858: Improve Doc: SyntaxWarning is emitted during bytecode generation... X-Git-Tag: v3.14.0rc3~114 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c35222aae122054e04b4fd033ba105413c03412d;p=thirdparty%2FPython%2Fcpython.git [3.14] gh-123858: Improve Doc: SyntaxWarning is emitted during bytecode generation (gh-122844) (#138244) Co-authored-by: Hang Co-authored-by: Alyssa Coghlan --- diff --git a/Doc/library/exceptions.rst b/Doc/library/exceptions.rst index 8cc887b8ceb3..9d3e0a4c20f9 100644 --- a/Doc/library/exceptions.rst +++ b/Doc/library/exceptions.rst @@ -890,6 +890,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 diff --git a/Doc/library/warnings.rst b/Doc/library/warnings.rst index 00bafd1be4bd..a2bb4b1830de 100644 --- a/Doc/library/warnings.rst +++ b/Doc/library/warnings.rst @@ -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. |