1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-25 17:36:13 +01:00

Use distro module to detect distro on all python versions

Also, add a related Recommends to to the spec file
This commit is contained in:
Daniel Mach 2023-01-20 13:24:50 +01:00
parent 987db92f3b
commit 6d01df35e6
2 changed files with 4 additions and 4 deletions

View File

@ -65,6 +65,9 @@ Requires: %{use_python_pkg}-urllib3
# needed for showing download progressbars
Recommends: %{use_python_pkg}-progressbar
# needed for setting the default editor by distro
Recommends: %{use_python_pkg}-distro
# needed for storing credentials in kwallet/gnome-keyring
Recommends: %{use_python_pkg}-keyring
Recommends: %{use_python_pkg}-keyring-keyutils

View File

@ -4203,10 +4203,7 @@ def read_meta_from_spec(specfile, *args):
def _get_linux_distro():
if distro is not None:
return distro.id()
elif sys.version_info >= (3, 8):
return None
# compatibility for Python 2.6 to 3.7
return platform.linux_distribution()[0]
return None
def get_default_editor():