From c21956b4f378000bdcdc67114219391cc0fbf187 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Fri, 17 Aug 2018 10:28:47 -0400 Subject: [PATCH] handle distro import error --- lbrynet/core/system_info.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lbrynet/core/system_info.py b/lbrynet/core/system_info.py index 12755033b..765ff7f49 100644 --- a/lbrynet/core/system_info.py +++ b/lbrynet/core/system_info.py @@ -36,9 +36,12 @@ def get_platform(get_ip=True): "build": build_type.BUILD, # CI server sets this during build step } if p["os_system"] == "Linux": - import distro - p["distro"] = distro.info() - p["desktop"] = os.environ.get('XDG_CURRENT_DESKTOP', 'Unknown') + try: + import distro + p["distro"] = distro.info() + p["desktop"] = os.environ.get('XDG_CURRENT_DESKTOP', 'Unknown') + except ModuleNotFoundError: + pass # TODO: remove this from get_platform and add a get_external_ip function using treq if get_ip: