Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Doc/library/platform.rst
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ Unix Platforms

This is another name for :func:`linux_distribution`.

.. deprecated-removed:: 3.5 3.7
.. deprecated-removed:: 3.5 3.8
See alternative like the `distro <https://pypi.org/project/distro>`_ package.

.. function:: linux_distribution(distname='', version='', id='', supported_dists=('SuSE','debian','redhat','mandrake',...), full_distribution_name=1)

Expand All @@ -266,7 +267,8 @@ Unix Platforms
parameters. ``id`` is the item in parentheses after the version number. It
is usually the version codename.

.. deprecated-removed:: 3.5 3.7
.. deprecated-removed:: 3.5 3.8
See alternative like the `distro <https://pypi.org/project/distro>`_ package.

.. function:: libc_ver(executable=sys.executable, lib='', version='', chunksize=2048)

Expand Down
6 changes: 3 additions & 3 deletions Lib/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def linux_distribution(distname='', version='', id='',
full_distribution_name=1):
import warnings
warnings.warn("dist() and linux_distribution() functions are deprecated "
"in Python 3.5", PendingDeprecationWarning, stacklevel=2)
"in Python 3.5", DeprecationWarning, stacklevel=2)
return _linux_distribution(distname, version, id, supported_dists,
full_distribution_name)

Expand Down Expand Up @@ -376,7 +376,7 @@ def dist(distname='', version='', id='',
"""
import warnings
warnings.warn("dist() and linux_distribution() functions are deprecated "
"in Python 3.5", PendingDeprecationWarning, stacklevel=2)
"in Python 3.5", DeprecationWarning, stacklevel=2)
return _linux_distribution(distname, version, id,
supported_dists=supported_dists,
full_distribution_name=0)
Expand Down Expand Up @@ -1345,7 +1345,7 @@ def platform(aliased=0, terse=0):
'ignore',
r'dist\(\) and linux_distribution\(\) '
'functions are deprecated .*',
PendingDeprecationWarning,
DeprecationWarning,
)
distname, distversion, distid = dist('')
if distname and not terse:
Expand Down
4 changes: 2 additions & 2 deletions Lib/test/test_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,14 +353,14 @@ def test_linux_distribution_encoding(self):
class DeprecationTest(unittest.TestCase):

def test_dist_deprecation(self):
with self.assertWarns(PendingDeprecationWarning) as cm:
with self.assertWarns(DeprecationWarning) as cm:
platform.dist()
self.assertEqual(str(cm.warning),
'dist() and linux_distribution() functions are '
'deprecated in Python 3.5')

def test_linux_distribution_deprecation(self):
with self.assertWarns(PendingDeprecationWarning) as cm:
with self.assertWarns(DeprecationWarning) as cm:
platform.linux_distribution()
self.assertEqual(str(cm.warning),
'dist() and linux_distribution() functions are '
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The function ``platform.linux_ditribution`` and ``platform.dist`` now
trigger a ``DeprecationWarning`` and have been marked for removal in Python
3.8