aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
authorJorgen Schaefer2016-04-27 10:44:40 +0200
committerJorgen Schaefer2016-04-27 10:46:43 +0200
commit1a08fb07546a4488511abb65bcae5c0d8b192c20 (patch)
tree5b7fb6b5528b7f79000e05403a42be2fc683455b /lisp/progmodes/python.el
parent5b5403289888efe8783ae6a405845b925f544ec1 (diff)
downloademacs-1a08fb07546a4488511abb65bcae5c0d8b192c20.tar.gz
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/progmodes/python.el')
-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'."
561 ;; Builtin Exceptions 561 ;; Builtin Exceptions
562 (,(rx symbol-start 562 (,(rx symbol-start
563 (or 563 (or
564 ;; Python 2 and 3:
564 "ArithmeticError" "AssertionError" "AttributeError" "BaseException" 565 "ArithmeticError" "AssertionError" "AttributeError" "BaseException"
565 "DeprecationWarning" "EOFError" "EnvironmentError" "Exception" 566 "BufferError" "BytesWarning" "DeprecationWarning" "EOFError"
566 "FloatingPointError" "FutureWarning" "GeneratorExit" "IOError" 567 "EnvironmentError" "Exception" "FloatingPointError" "FutureWarning"
567 "ImportError" "ImportWarning" "IndexError" "KeyError" 568 "GeneratorExit" "IOError" "ImportError" "ImportWarning"
568 "KeyboardInterrupt" "LookupError" "MemoryError" "NameError" 569 "IndentationError" "IndexError" "KeyError" "KeyboardInterrupt"
569 "NotImplementedError" "OSError" "OverflowError" 570 "LookupError" "MemoryError" "NameError" "NotImplementedError"
570 "PendingDeprecationWarning" "ReferenceError" "RuntimeError" 571 "OSError" "OverflowError" "PendingDeprecationWarning"
571 "RuntimeWarning" "StopIteration" "SyntaxError" "SyntaxWarning" 572 "ReferenceError" "RuntimeError" "RuntimeWarning" "StopIteration"
572 "SystemError" "SystemExit" "TypeError" "UnboundLocalError" 573 "SyntaxError" "SyntaxWarning" "SystemError" "SystemExit" "TabError"
573 "UnicodeDecodeError" "UnicodeEncodeError" "UnicodeError" 574 "TypeError" "UnboundLocalError" "UnicodeDecodeError"
574 "UnicodeTranslateError" "UnicodeWarning" "UserWarning" "VMSError" 575 "UnicodeEncodeError" "UnicodeError" "UnicodeTranslateError"
575 "ValueError" "Warning" "WindowsError" "ZeroDivisionError" 576 "UnicodeWarning" "UserWarning" "ValueError" "Warning"
577 "ZeroDivisionError"
576 ;; Python 2: 578 ;; Python 2:
577 "StandardError" 579 "StandardError"
578 ;; Python 3: 580 ;; Python 3:
579 "BufferError" "BytesWarning" "IndentationError" "ResourceWarning" 581 "BlockingIOError" "BrokenPipeError" "ChildProcessError"
580 "TabError") 582 "ConnectionAbortedError" "ConnectionError" "ConnectionRefusedError"
583 "ConnectionResetError" "FileExistsError" "FileNotFoundError"
584 "InterruptedError" "IsADirectoryError" "NotADirectoryError"
585 "PermissionError" "ProcessLookupError" "RecursionError"
586 "ResourceWarning" "StopAsyncIteration" "TimeoutError"
587 ;; OS specific
588 "VMSError" "WindowsError"
589 )
581 symbol-end) . font-lock-type-face) 590 symbol-end) . font-lock-type-face)
582 ;; Builtins 591 ;; Builtins
583 (,(rx symbol-start 592 (,(rx symbol-start