mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Issue #1322: platform.dist() and platform.linux_distribution() functions are now deprecated.
Initial patch by Vajrasky Kok.
This commit is contained in:
parent
de7cafaa63
commit
2f3742b0d8
5 changed files with 47 additions and 8 deletions
|
@ -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):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue