diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2021-01-17 07:44:58 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-17 16:44:58 +0100 |
commit | debda34e2d4f28d6d369cdafdcba4791702f63fc (patch) | |
tree | 68799677bf5f81be5e32af24670277721adc5845 /external | |
parent | 19d2096185de3282345eab1da611e56a26bcaec2 (diff) | |
download | pygments-git-debda34e2d4f28d6d369cdafdcba4791702f63fc.tar.gz |
Run pyupgrade across codebase to modernize syntax and patterns (#1622)
pyupgrade is a tool to automatically upgrade syntax for newer versions
of the Python language.
The project has been Python 3 only since
35544e2fc6eed0ce4a27ec7285aac71ff0ddc473, allowing for several cleanups:
- Remove unnecessary "-*- coding: utf-8 -*-" cookie. Python 3 reads all
source files as utf-8 by default.
- Replace IOError/EnvironmentError with OSError. Python 3 unified these
exceptions. The old names are aliases only.
- Use the Python 3 shorter super() syntax.
- Remove "utf8" argument form encode/decode. In Python 3, this value is
the default.
- Remove "r" from open() calls. In Python 3, this value is the default.
- Remove u prefix from Unicode strings. In Python 3, all strings are
Unicode.
- Replace io.open() with builtin open(). In Python 3, these functions
are functionally equivalent.
Co-authored-by: Matthäus G. Chajdas <Anteru@users.noreply.github.com>
Diffstat (limited to 'external')
-rw-r--r-- | external/markdown-processor.py | 1 | ||||
-rw-r--r-- | external/moin-parser.py | 1 | ||||
-rw-r--r-- | external/rst-directive.py | 1 |
3 files changed, 0 insertions, 3 deletions
diff --git a/external/markdown-processor.py b/external/markdown-processor.py index 8d1afbbb..eaf913e9 100644 --- a/external/markdown-processor.py +++ b/external/markdown-processor.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ The Pygments Markdown Preprocessor ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/external/moin-parser.py b/external/moin-parser.py index b8d62f40..9fcba80b 100644 --- a/external/moin-parser.py +++ b/external/moin-parser.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ The Pygments MoinMoin Parser ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/external/rst-directive.py b/external/rst-directive.py index 90462561..a82ecfaf 100644 --- a/external/rst-directive.py +++ b/external/rst-directive.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ The Pygments reStructuredText directive ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |