summaryrefslogtreecommitdiff
path: root/pygments/lexers/python.py
diff options
context:
space:
mode:
authorKevin Stock <kevin@kevinstock.org>2022-04-06 02:11:07 -0400
committerGitHub <noreply@github.com>2022-04-06 08:11:07 +0200
commitc155bc4e52e313a51a03f9dcafa64b92701a6829 (patch)
treed2960c9b360f4e345e0c914d595e448ebbc49b27 /pygments/lexers/python.py
parent06923a1a47ea3cc0f742af23d7949bf17773e5c8 (diff)
downloadpygments-git-c155bc4e52e313a51a03f9dcafa64b92701a6829.tar.gz
Highlight python 3.10's EncodingWarning (#2106)
EncodingWarning was added in 3.10: https://docs.python.org/3/library/exceptions.html#EncodingWarning
Diffstat (limited to 'pygments/lexers/python.py')
-rw-r--r--pygments/lexers/python.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pygments/lexers/python.py b/pygments/lexers/python.py
index f0cd9d7c..83c5ef4e 100644
--- a/pygments/lexers/python.py
+++ b/pygments/lexers/python.py
@@ -258,7 +258,8 @@ class PythonLexer(RegexLexer):
'InterruptedError', 'IsADirectoryError', 'NotADirectoryError',
'PermissionError', 'ProcessLookupError', 'TimeoutError',
# others new in Python 3
- 'StopAsyncIteration', 'ModuleNotFoundError', 'RecursionError'),
+ 'StopAsyncIteration', 'ModuleNotFoundError', 'RecursionError',
+ 'EncodingWarning'),
prefix=r'(?<!\.)', suffix=r'\b'),
Name.Exception),
],