summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2020-02-27 05:50:51 +0100
committerGitHub <noreply@github.com>2020-02-27 05:50:51 +0100
commit154f3a0c9ef4a57fff7af3568b7d88552db640d8 (patch)
treee1650daa131f2063619d6ed849e37427b65a775c
parent7eb42bdad33c1c56c5d396315a5715a5a74fab0e (diff)
parent499f02c4339484f0915b88a9c49d1a12e87633ed (diff)
downloadpygments-git-154f3a0c9ef4a57fff7af3568b7d88552db640d8.tar.gz
Merge pull request #1400 from verhovsky/patch-1
Move Python 3-only exceptions into PythonLexer
-rw-r--r--pygments/lexers/python.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/pygments/lexers/python.py b/pygments/lexers/python.py
index 8e1debac..993a9359 100644
--- a/pygments/lexers/python.py
+++ b/pygments/lexers/python.py
@@ -176,7 +176,7 @@ class PythonLexer(RegexLexer):
'InterruptedError', 'IsADirectoryError', 'NotADirectoryError',
'PermissionError', 'ProcessLookupError', 'TimeoutError',
# others new in Python 3
- 'StopAsyncIteration'),
+ 'StopAsyncIteration', 'ModuleNotFoundError', 'RecursionError'),
prefix=r'(?<!\.)', suffix=r'\b'),
Name.Exception),
],
@@ -391,9 +391,9 @@ class Python2Lexer(RegexLexer):
'Exception', 'FloatingPointError', 'FutureWarning', 'GeneratorExit',
'IOError', 'ImportError', 'ImportWarning', 'IndentationError',
'IndexError', 'KeyError', 'KeyboardInterrupt', 'LookupError',
- 'MemoryError', 'ModuleNotFoundError', 'NameError',
+ 'MemoryError', 'NameError',
'NotImplementedError', 'OSError', 'OverflowError', 'OverflowWarning',
- 'PendingDeprecationWarning', 'RecursionError', 'ReferenceError',
+ 'PendingDeprecationWarning', 'ReferenceError',
'RuntimeError', 'RuntimeWarning', 'StandardError', 'StopIteration',
'SyntaxError', 'SyntaxWarning', 'SystemError', 'SystemExit',
'TabError', 'TypeError', 'UnboundLocalError', 'UnicodeDecodeError',