summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorJorgen Schaefer <contact@jorgenschaefer.de>2016-04-27 10:44:40 +0200
committerJorgen Schaefer <contact@jorgenschaefer.de>2016-04-27 10:46:43 +0200
commit1a08fb07546a4488511abb65bcae5c0d8b192c20 (patch)
tree5b7fb6b5528b7f79000e05403a42be2fc683455b /lisp
parent5b5403289888efe8783ae6a405845b925f544ec1 (diff)
downloademacs-1a08fb07546a4488511abb65bcae5c0d8b192c20.tar.gz
emacs-1a08fb07546a4488511abb65bcae5c0d8b192c20.tar.bz2
emacs-1a08fb07546a4488511abb65bcae5c0d8b192c20.zip
Add a number of Python 3 exceptions
* lisp/progmoes/python.el (python-font-lock-keywords): Clean up the exception list, adding a number of new Python 3 exceptions and moving some exceptions to the Python 2 and 3 list as Python 2.7 includes them.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/progmodes/python.el35
1 files changed, 22 insertions, 13 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 1898e0d3b8c..1e7a15d382a 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -561,23 +561,32 @@ The type returned can be `comment', `string' or `paren'."
;; Builtin Exceptions
(,(rx symbol-start
(or
+ ;; Python 2 and 3:
"ArithmeticError" "AssertionError" "AttributeError" "BaseException"
- "DeprecationWarning" "EOFError" "EnvironmentError" "Exception"
- "FloatingPointError" "FutureWarning" "GeneratorExit" "IOError"
- "ImportError" "ImportWarning" "IndexError" "KeyError"
- "KeyboardInterrupt" "LookupError" "MemoryError" "NameError"
- "NotImplementedError" "OSError" "OverflowError"
- "PendingDeprecationWarning" "ReferenceError" "RuntimeError"
- "RuntimeWarning" "StopIteration" "SyntaxError" "SyntaxWarning"
- "SystemError" "SystemExit" "TypeError" "UnboundLocalError"
- "UnicodeDecodeError" "UnicodeEncodeError" "UnicodeError"
- "UnicodeTranslateError" "UnicodeWarning" "UserWarning" "VMSError"
- "ValueError" "Warning" "WindowsError" "ZeroDivisionError"
+ "BufferError" "BytesWarning" "DeprecationWarning" "EOFError"
+ "EnvironmentError" "Exception" "FloatingPointError" "FutureWarning"
+ "GeneratorExit" "IOError" "ImportError" "ImportWarning"
+ "IndentationError" "IndexError" "KeyError" "KeyboardInterrupt"
+ "LookupError" "MemoryError" "NameError" "NotImplementedError"
+ "OSError" "OverflowError" "PendingDeprecationWarning"
+ "ReferenceError" "RuntimeError" "RuntimeWarning" "StopIteration"
+ "SyntaxError" "SyntaxWarning" "SystemError" "SystemExit" "TabError"
+ "TypeError" "UnboundLocalError" "UnicodeDecodeError"
+ "UnicodeEncodeError" "UnicodeError" "UnicodeTranslateError"
+ "UnicodeWarning" "UserWarning" "ValueError" "Warning"
+ "ZeroDivisionError"
;; Python 2:
"StandardError"
;; Python 3:
- "BufferError" "BytesWarning" "IndentationError" "ResourceWarning"
- "TabError")
+ "BlockingIOError" "BrokenPipeError" "ChildProcessError"
+ "ConnectionAbortedError" "ConnectionError" "ConnectionRefusedError"
+ "ConnectionResetError" "FileExistsError" "FileNotFoundError"
+ "InterruptedError" "IsADirectoryError" "NotADirectoryError"
+ "PermissionError" "ProcessLookupError" "RecursionError"
+ "ResourceWarning" "StopAsyncIteration" "TimeoutError"
+ ;; OS specific
+ "VMSError" "WindowsError"
+ )
symbol-end) . font-lock-type-face)
;; Builtins
(,(rx symbol-start