Skip to content

Commit 9eb40bc

Browse files
Carreauencukou
authored andcommitted
bpo-28167: bump platform.linux_distribution removal to 3.8 (GH-6669)
Also bump PendingDeprecationWarning to DeprecationWarning.
1 parent 01abc6e commit 9eb40bc

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

Doc/library/platform.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,8 @@ Unix Platforms
248248

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

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

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

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

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

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

Lib/platform.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ def linux_distribution(distname='', version='', id='',
302302
full_distribution_name=1):
303303
import warnings
304304
warnings.warn("dist() and linux_distribution() functions are deprecated "
305-
"in Python 3.5", PendingDeprecationWarning, stacklevel=2)
305+
"in Python 3.5", DeprecationWarning, stacklevel=2)
306306
return _linux_distribution(distname, version, id, supported_dists,
307307
full_distribution_name)
308308

@@ -376,7 +376,7 @@ def dist(distname='', version='', id='',
376376
"""
377377
import warnings
378378
warnings.warn("dist() and linux_distribution() functions are deprecated "
379-
"in Python 3.5", PendingDeprecationWarning, stacklevel=2)
379+
"in Python 3.5", DeprecationWarning, stacklevel=2)
380380
return _linux_distribution(distname, version, id,
381381
supported_dists=supported_dists,
382382
full_distribution_name=0)
@@ -1345,7 +1345,7 @@ def platform(aliased=0, terse=0):
13451345
'ignore',
13461346
r'dist\(\) and linux_distribution\(\) '
13471347
'functions are deprecated .*',
1348-
PendingDeprecationWarning,
1348+
DeprecationWarning,
13491349
)
13501350
distname, distversion, distid = dist('')
13511351
if distname and not terse:

Lib/test/test_platform.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,14 +353,14 @@ def test_linux_distribution_encoding(self):
353353
class DeprecationTest(unittest.TestCase):
354354

355355
def test_dist_deprecation(self):
356-
with self.assertWarns(PendingDeprecationWarning) as cm:
356+
with self.assertWarns(DeprecationWarning) as cm:
357357
platform.dist()
358358
self.assertEqual(str(cm.warning),
359359
'dist() and linux_distribution() functions are '
360360
'deprecated in Python 3.5')
361361

362362
def test_linux_distribution_deprecation(self):
363-
with self.assertWarns(PendingDeprecationWarning) as cm:
363+
with self.assertWarns(DeprecationWarning) as cm:
364364
platform.linux_distribution()
365365
self.assertEqual(str(cm.warning),
366366
'dist() and linux_distribution() functions are '
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
The function ``platform.linux_ditribution`` and ``platform.dist`` now
2+
trigger a ``DeprecationWarning`` and have been marked for removal in Python
3+
3.8

0 commit comments

Comments
 (0)