diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2022-02-13 20:15:35 -0500 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2022-04-14 18:37:03 -0400 |
commit | bb171c2dffd64724803c9a43d7b01e80c3a96064 (patch) | |
tree | 247a84fba58b9e24c9f05c78cf9d8164f8f2d7a1 /mesonbuild/mesonmain.py | |
parent | 906aec0df58c9b0fb411edca1934e7263e5d339f (diff) | |
download | meson-bb171c2dffd64724803c9a43d7b01e80c3a96064.zip meson-bb171c2dffd64724803c9a43d7b01e80c3a96064.tar.gz meson-bb171c2dffd64724803c9a43d7b01e80c3a96064.tar.bz2 |
pyupgrade --py37-plus
Some more old style code crept in again.
Additionally, pyupgrade learned to catch more if/elsed code based on the
python version, and delete it.
Diffstat (limited to 'mesonbuild/mesonmain.py')
-rw-r--r-- | mesonbuild/mesonmain.py | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py index 5c24931..5e8cebd 100644 --- a/mesonbuild/mesonmain.py +++ b/mesonbuild/mesonmain.py @@ -22,7 +22,6 @@ import platform import importlib import traceback import argparse -import codecs import shutil from . import mesonlib @@ -207,14 +206,7 @@ def run_script_command(script_name, script_args): def ensure_stdout_accepts_unicode(): if sys.stdout.encoding and not sys.stdout.encoding.upper().startswith('UTF-'): - if sys.version_info >= (3, 7): - sys.stdout.reconfigure(errors='surrogateescape') - else: - sys.stdout = codecs.getwriter('utf-8')(sys.stdout.detach(), - errors='surrogateescape') - sys.stdout.encoding = 'UTF-8' - if not hasattr(sys.stdout, 'buffer'): - sys.stdout.buffer = sys.stdout.raw if hasattr(sys.stdout, 'raw') else sys.stdout + sys.stdout.reconfigure(errors='surrogateescape') def run(original_args, mainfile): if sys.version_info < (3, 7): |