]> git.eshelyaron.com Git - emacs.git/commitdiff
Add all exceptions up to Python 3.13 as keywords
authorStefan Kangas <stefankangas@gmail.com>
Sat, 21 Sep 2024 12:13:47 +0000 (14:13 +0200)
committerEshel Yaron <me@eshelyaron.com>
Mon, 23 Sep 2024 10:45:27 +0000 (12:45 +0200)
* 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

index cd8befdb1d5dc1c7a8e4e743e9c56da602933133..1b4f59270824b8d07ba478205dec0b93bfc65542 100644 (file)
@@ -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"
     ))