void-packages/srcpkgs/libbytesize/patches/musl-fix-test.diff

18 lines
705 B
Diff

diff --git a/tests/locale_utils.py b/tests/locale_utils.py
index 7e4f369..c16f1bd 100644
--- a/tests/locale_utils.py
+++ b/tests/locale_utils.py
@@ -4,7 +4,11 @@ import subprocess
"""Helper functions, decorators,... for working with locales"""
def get_avail_locales():
- return {loc.decode(errors="replace").strip() for loc in subprocess.check_output(["locale", "-a"]).split()}
+ try:
+ return {loc.decode(errors="replace").strip() for loc in subprocess.check_output(["locale", "-a"]).split()}
+ except FileNotFoundError:
+ # musl and some other libc's don't support locales beyond what POSIX requires.
+ return {"C.UTF-8"}
def missing_locales(required, available):