From 63bc9b8a4fe922befac8c8b0000d30b22911d797 Mon Sep 17 00:00:00 2001 From: Puneeth Chaganti Date: Fri, 1 Nov 2019 12:45:28 +0530 Subject: [PATCH] zulip: Use distro.linux_distribution instead of platform Python 3.8 removes `platform.linux_distribution` and `distro` is the recommended replacement to use for this function. --- requirements.txt | 1 + zulip/zulip/__init__.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a22c3a9..a8e80eb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,6 +4,7 @@ coverage>=4.4.1 pycodestyle==2.3.1 mock pytest +distro -e ./zulip -e ./zulip_bots -e ./zulip_botserver diff --git a/zulip/zulip/__init__.py b/zulip/zulip/__init__.py index f0d3638..4159d61 100644 --- a/zulip/zulip/__init__.py +++ b/zulip/zulip/__init__.py @@ -36,6 +36,7 @@ import random import types from distutils.version import LooseVersion +import distro from six.moves.configparser import SafeConfigParser from six.moves import urllib import logging @@ -463,7 +464,7 @@ class Client(object): pass if vendor == "Linux": - vendor, vendor_version, dummy = platform.linux_distribution() + vendor, vendor_version, dummy = distro.linux_distribution() elif vendor == "Windows": vendor_version = platform.win32_ver()[1] elif vendor == "Darwin":