From 27a726ffe1b730125062b04a7469819dabc0630c Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 21 Sep 2024 14:13:47 +0200 Subject: [PATCH] Add all exceptions up to Python 3.13 as keywords * lisp/progmodes/python.el (python-font-lock-keywords-maximum-decoration) (python--treesit-exceptions): Add all built-in exceptions in Python 3.13 as keywords. Missing from the list was "BaseExceptionGroup", "EncodingWarning", "ModuleNotFoundError", and "PythonFinalizationError". (cherry picked from commit 7aa5876cdf3df3ac0fa67a1dd06b49077dd0b8cf) --- lisp/progmodes/python.el | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index cd8befdb1d5..1b4f5927082 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -789,11 +789,12 @@ sign in chained assignment." ;; Python 3: "BlockingIOError" "BrokenPipeError" "ChildProcessError" "ConnectionAbortedError" "ConnectionError" "ConnectionRefusedError" - "ConnectionResetError" "FileExistsError" "FileNotFoundError" - "InterruptedError" "IsADirectoryError" "NotADirectoryError" - "PermissionError" "ProcessLookupError" "RecursionError" + "ConnectionResetError" "EncodingWarning" "FileExistsError" + "FileNotFoundError" "InterruptedError" "IsADirectoryError" + "NotADirectoryError" "ModuleNotFoundError" "PermissionError" + "ProcessLookupError" "PythonFinalizationError" "RecursionError" "ResourceWarning" "StopAsyncIteration" "TimeoutError" - "ExceptionGroup" + "BaseExceptionGroup" "ExceptionGroup" ;; OS specific "VMSError" "WindowsError" ) @@ -1063,11 +1064,12 @@ It makes underscores and dots word constituent chars.") ;; Python 3: "BlockingIOError" "BrokenPipeError" "ChildProcessError" "ConnectionAbortedError" "ConnectionError" "ConnectionRefusedError" - "ConnectionResetError" "FileExistsError" "FileNotFoundError" - "InterruptedError" "IsADirectoryError" "NotADirectoryError" - "PermissionError" "ProcessLookupError" "RecursionError" + "ConnectionResetError" "EncodingWarning" "FileExistsError" + "FileNotFoundError" "InterruptedError" "IsADirectoryError" + "NotADirectoryError" "ModuleNotFoundError" "PermissionError" + "ProcessLookupError" "PythonFinalizationError" "RecursionError" "ResourceWarning" "StopAsyncIteration" "TimeoutError" - "ExceptionGroup" + "BaseExceptionGroup" "ExceptionGroup" ;; OS specific "VMSError" "WindowsError" )) -- 2.39.2