moved import distro into conditional statement that only runs on Linux

This commit is contained in:
Lex Berezhny 2018-05-29 14:49:06 -04:00
parent 09e272a642
commit 6a344539a0

View file

@ -2,7 +2,6 @@ import platform
import json import json
import subprocess import subprocess
import os import os
import distro
from urllib2 import urlopen, URLError from urllib2 import urlopen, URLError
from lbryschema import __version__ as lbryschema_version from lbryschema import __version__ as lbryschema_version
@ -38,6 +37,7 @@ def get_platform(get_ip=True):
"build": build_type.BUILD, # CI server sets this during build step "build": build_type.BUILD, # CI server sets this during build step
} }
if p["os_system"] == "Linux": if p["os_system"] == "Linux":
import distro
p["distro"] = distro.info() p["distro"] = distro.info()
p["desktop"] = os.environ.get('XDG_CURRENT_DESKTOP', 'Unknown') p["desktop"] = os.environ.get('XDG_CURRENT_DESKTOP', 'Unknown')