diff --git a/specfile/changelog.py b/specfile/changelog.py index 506a6f4e..89c3d463 100644 --- a/specfile/changelog.py +++ b/specfile/changelog.py @@ -400,15 +400,13 @@ def guess_packager() -> str: if shutil.which("git"): email = subprocess.run( ["git", "config", "user.email"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - universal_newlines=True, + capture_output=True, + text=True, ).stdout.strip() fullname = subprocess.run( ["git", "config", "user.name"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - universal_newlines=True, + capture_output=True, + text=True, ).stdout.strip() if not fullname: fullname = _getent_name() diff --git a/tests/unit/test_guess_packager.py b/tests/unit/test_guess_packager.py index 5327aaf8..e5d78797 100644 --- a/tests/unit/test_guess_packager.py +++ b/tests/unit/test_guess_packager.py @@ -44,20 +44,16 @@ def set_packager_git(monkeypatch: MonkeyPatch, tmp_path: Path) -> str: packager = "Packager, Patty " monkeypatch.chdir(tmp_path) - subprocess.run( - ["git", "init", "."], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE - ) + subprocess.run(["git", "init", "."], check=True, capture_output=True) subprocess.run( ["git", "config", "user.name", "Packager, Patty"], check=True, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, + capture_output=True, ) subprocess.run( ["git", "config", "user.email", "packager@patty.dev"], check=True, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, + capture_output=True, ) return packager