From e5a7893a99d64acb18ca8eec8848daa026c1c4de Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Fri, 11 Aug 2023 11:14:01 -0700 Subject: [PATCH] Update pyupgrade to Python 3.7+ (#580) --- .pre-commit-config.yaml | 2 +- src/packaging/_musllinux.py | 2 +- src/packaging/tags.py | 2 +- tests/test_musllinux.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8f449ffc..c03c4d43 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: rev: v3.3.1 hooks: - id: pyupgrade - args: [--py36-plus] + args: [--py37-plus] - repo: https://github.com/psf/black rev: 22.12.0 diff --git a/src/packaging/_musllinux.py b/src/packaging/_musllinux.py index a71f85ee..86419df9 100644 --- a/src/packaging/_musllinux.py +++ b/src/packaging/_musllinux.py @@ -47,7 +47,7 @@ def _get_musl_version(executable: str) -> Optional[_MuslVersion]: return None if ld is None or "musl" not in ld: return None - proc = subprocess.run([ld], stderr=subprocess.PIPE, universal_newlines=True) + proc = subprocess.run([ld], stderr=subprocess.PIPE, text=True) return _parse_musl_version(proc.stderr) diff --git a/src/packaging/tags.py b/src/packaging/tags.py index a389a7b7..07411493 100644 --- a/src/packaging/tags.py +++ b/src/packaging/tags.py @@ -406,7 +406,7 @@ def mac_platforms( check=True, env={"SYSTEM_VERSION_COMPAT": "0"}, stdout=subprocess.PIPE, - universal_newlines=True, + text=True, ).stdout version = cast("MacVersion", tuple(map(int, version_str.split(".")[:2]))) else: diff --git a/tests/test_musllinux.py b/tests/test_musllinux.py index c2ab8601..1a6a9a26 100644 --- a/tests/test_musllinux.py +++ b/tests/test_musllinux.py @@ -72,7 +72,7 @@ def mock_run(*args, **kwargs): pretend.call( [ld_musl], stderr=subprocess.PIPE, - universal_newlines=True, + text=True, ) ] else: