From 88d2cb397622ad75f7c71a15e7872fd66902bab2 Mon Sep 17 00:00:00 2001 From: jack1142 <6032823+jack1142@users.noreply.github.com> Date: Tue, 5 Apr 2022 22:33:43 +0200 Subject: [PATCH] Suppress stderr in `_get_version()` (#5667) --- redbot/_version.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/redbot/_version.py b/redbot/_version.py index 8d455e47f..4f1ab1260 100644 --- a/redbot/_version.py +++ b/redbot/_version.py @@ -7,7 +7,9 @@ def _get_version(*, ignore_installed: bool = False) -> str: path = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) output = subprocess.check_output( - ("git", "describe", "--tags", "--long", "--dirty"), cwd=path + ("git", "describe", "--tags", "--long", "--dirty"), + stderr=subprocess.DEVNULL, + cwd=path, ) _, count, commit, *dirty = output.decode("utf-8").strip().split("-", 3) dirty_suffix = f".{dirty[0]}" if dirty else ""