From b8da66bacec10ac3d480caf809c0669ae4e447af Mon Sep 17 00:00:00 2001 From: Joe Burzinski Date: Wed, 17 Jun 2020 23:37:51 -0500 Subject: [PATCH] Remove linux_distribution import from platform. Replace the call to linux_distribution for Linux systems with the human readable output of platform(). Example Linux USER_AGENT: `python-ipify/1.0.0 python/3.8.3 Linux/Linux-5.6.16-1-MANJARO-x86_64-with-glibc2.2.5` Update .gitignore to exclude JetBrains workspace junk. --- .gitignore | 4 ++++ ipify/settings.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 2ff7218..6811474 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,7 @@ *.egg-info build dist + +# JetBrains/PyCharm +.idea/ +venv*/ diff --git a/ipify/settings.py b/ipify/settings.py index 17aebc9..d379993 100644 --- a/ipify/settings.py +++ b/ipify/settings.py @@ -6,7 +6,7 @@ """ -from platform import mac_ver, win32_ver, linux_distribution, system +from platform import mac_ver, win32_ver, system, platform from sys import version_info as vi from . import __version__ @@ -21,7 +21,7 @@ # This dictionary is used to dynamically select the appropriate platform for # the user agent string. OS_VERSION_INFO = { - 'Linux': '%s' % (linux_distribution()[0]), + 'Linux': '%s' % (platform()), 'Windows': '%s' % (win32_ver()[0]), 'Darwin': '%s' % (mac_ver()[0]), }