summaryrefslogtreecommitdiff
path: root/pygments/lexers/python.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2019-11-24 16:28:29 +0100
committerGeorg Brandl <georg@python.org>2019-11-24 16:40:54 +0100
commitab2144fca3ecba6bd585912fe3c2a342d55859be (patch)
tree735766bf4e627742b0a425f0637fb28d18f3fcaa /pygments/lexers/python.py
parent06028bddcd2466b009363302669ee33b810ee185 (diff)
downloadpygments-git-ab2144fca3ecba6bd585912fe3c2a342d55859be.tar.gz
Python 3: add StopAsyncIteration exception (bitbucket PR #701)
Diffstat (limited to 'pygments/lexers/python.py')
-rw-r--r--pygments/lexers/python.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pygments/lexers/python.py b/pygments/lexers/python.py
index 112cd12a..53063f3f 100644
--- a/pygments/lexers/python.py
+++ b/pygments/lexers/python.py
@@ -341,7 +341,9 @@ class Python3Lexer(RegexLexer):
'BrokenPipeError', 'ConnectionAbortedError', 'ConnectionRefusedError',
'ConnectionResetError', 'FileExistsError', 'FileNotFoundError',
'InterruptedError', 'IsADirectoryError', 'NotADirectoryError',
- 'PermissionError', 'ProcessLookupError', 'TimeoutError'),
+ 'PermissionError', 'ProcessLookupError', 'TimeoutError',
+ # others new in Python 3
+ 'StopAsyncIteration'),
prefix=r'(?<!\.)', suffix=r'\b'),
Name.Exception),
]
@@ -414,7 +416,6 @@ class Python3Lexer(RegexLexer):
tokens['strings-single'] = innerstring_rules(String.Single)
tokens['strings-double'] = innerstring_rules(String.Double)
-
def analyse_text(text):
return shebang_matches(text, r'pythonw?3(\.\d)?')