From 99817fc9b17547f140dfaeb40d03db2fbbb54857 Mon Sep 17 00:00:00 2001 From: Samuel FORESTIER Date: Sun, 10 Oct 2021 17:35:11 +0200 Subject: [PATCH] Note that `distro.version` can return an empty string against rolling releases > close #251 [skip ci] --- distro.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/distro.py b/distro.py index 4d4b614..5bddb82 100755 --- a/distro.py +++ b/distro.py @@ -308,6 +308,10 @@ def version(pretty: bool = False, best: bool = False) -> str: sources in a fixed priority order does not always yield the most precise version (e.g. for Debian 8.2, or CentOS 7.1). + Some other distributions may not provide this kind of information. In these + cases, an empty string would be returned. This behavior can be observed + with rolling releases distributions (e.g. Arch Linux). + The *best* parameter can be used to control the approach for the returned version: