summaryrefslogtreecommitdiffstats
path: root/Lib/platform.py
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2015-05-13 09:32:20 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2015-05-13 09:32:20 (GMT)
commit2f3742b0d8dbe025f2f9e496938a6d344e6881ad (patch)
tree480fc929c731bf5081552dec4e3ff730144c82fa /Lib/platform.py
parentde7cafaa63db3849d11b1d17195ee23eacad7325 (diff)
downloadcpython-2f3742b0d8dbe025f2f9e496938a6d344e6881ad.zip
cpython-2f3742b0d8dbe025f2f9e496938a6d344e6881ad.tar.gz
cpython-2f3742b0d8dbe025f2f9e496938a6d344e6881ad.tar.bz2
Issue #1322: platform.dist() and platform.linux_distribution() functions are now deprecated.
Initial patch by Vajrasky Kok.
Diffstat (limited to 'Lib/platform.py')
-rwxr-xr-xLib/platform.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/Lib/platform.py b/Lib/platform.py
index b1c659e..52a009a 100755
--- a/Lib/platform.py
+++ b/Lib/platform.py
@@ -297,6 +297,15 @@ def linux_distribution(distname='', version='', id='',
supported_dists=_supported_dists,
full_distribution_name=1):
+ import warnings
+ warnings.warn("dist() and linux_distribution() functions are deprecated "
+ "in Python 3.5 and will be removed in Python 3.7",
+ PendingDeprecationWarning, stacklevel=2)
+ return _linux_distribution(distname, version, id, supported_dists,
+ full_distribution_name)
+
+def _linux_distribution(distname, version, id, supported_dists,
+ full_distribution_name):
""" Tries to determine the name of the Linux OS distribution name.
@@ -363,9 +372,13 @@ def dist(distname='', version='', id='',
args given as parameters.
"""
- return linux_distribution(distname, version, id,
- supported_dists=supported_dists,
- full_distribution_name=0)
+ import warnings
+ warnings.warn("dist() and linux_distribution() functions are deprecated "
+ "in Python 3.5 and will be removed in Python 3.7",
+ PendingDeprecationWarning, stacklevel=2)
+ return _linux_distribution(distname, version, id,
+ supported_dists=supported_dists,
+ full_distribution_name=0)
def popen(cmd, mode='r', bufsize=-1):