From ef232685735a29f6d588d95ac271c82fca4ea6e8 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 4 Mar 2019 15:39:10 +1000 Subject: [PATCH] use distro in place of deprecated dist() method --- anki/utils.py | 5 +++-- requirements.txt | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/anki/utils.py b/anki/utils.py index 4d50d25c2..728bb8c48 100644 --- a/anki/utils.py +++ b/anki/utils.py @@ -388,8 +388,9 @@ def platDesc(): elif isWin: theos = "win:%s" % (platform.win32_ver()[0]) elif system == "Linux": - dist = platform.dist() - theos = "lin:%s:%s" % (dist[0], dist[1]) + import distro + r = distro.linux_distribution(full_distribution_name=False) + theos = "lin:%s:%s" % (r[0], r[1]) else: theos = system break diff --git a/requirements.txt b/requirements.txt index 58c98a64d..1513b9ebc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,4 @@ requests decorator markdown psutil; sys_platform == "win32" +distro; sys_platform != "win32" and sys_platform != "darwin"