Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e50d846

Browse files
committed
Issue #26041: Remove "will be removed in Python 3.7" from description messages
We will keep platform.dist() and platform.linux_distribution() to make porting from Python 2 easier. Patch by Kumaripaba Miyurusara Athukorala.
2 parents 8d9594d + 8d8221f commit e50d846

4 files changed

Lines changed: 10 additions & 11 deletions

File tree

Doc/whatsnew/3.5.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2271,9 +2271,8 @@ class has been deprecated.
22712271
(Contributed by Serhiy Storchaka in :issue:`23671`.)
22722272

22732273
The :func:`platform.dist` and :func:`platform.linux_distribution` functions
2274-
are now deprecated and will be removed in Python 3.7. Linux distributions use
2275-
too many different ways of describing themselves, so the functionality is
2276-
left to a package.
2274+
are now deprecated. Linux distributions use too many different ways of
2275+
describing themselves, so the functionality is left to a package.
22772276
(Contributed by Vajrasky Kok and Berker Peksag in :issue:`1322`.)
22782277

22792278
The previously undocumented ``from_function`` and ``from_builtin`` methods of

Lib/platform.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,7 @@ def linux_distribution(distname='', version='', id='',
303303
full_distribution_name=1):
304304
import warnings
305305
warnings.warn("dist() and linux_distribution() functions are deprecated "
306-
"in Python 3.5 and will be removed in Python 3.7",
307-
PendingDeprecationWarning, stacklevel=2)
306+
"in Python 3.5", PendingDeprecationWarning, stacklevel=2)
308307
return _linux_distribution(distname, version, id, supported_dists,
309308
full_distribution_name)
310309

@@ -378,8 +377,7 @@ def dist(distname='', version='', id='',
378377
"""
379378
import warnings
380379
warnings.warn("dist() and linux_distribution() functions are deprecated "
381-
"in Python 3.5 and will be removed in Python 3.7",
382-
PendingDeprecationWarning, stacklevel=2)
380+
"in Python 3.5", PendingDeprecationWarning, stacklevel=2)
383381
return _linux_distribution(distname, version, id,
384382
supported_dists=supported_dists,
385383
full_distribution_name=0)

Lib/test/test_platform.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,16 +333,14 @@ def test_dist_deprecation(self):
333333
platform.dist()
334334
self.assertEqual(str(cm.warning),
335335
'dist() and linux_distribution() functions are '
336-
'deprecated in Python 3.5 and will be removed in '
337-
'Python 3.7')
336+
'deprecated in Python 3.5')
338337

339338
def test_linux_distribution_deprecation(self):
340339
with self.assertWarns(PendingDeprecationWarning) as cm:
341340
platform.linux_distribution()
342341
self.assertEqual(str(cm.warning),
343342
'dist() and linux_distribution() functions are '
344-
'deprecated in Python 3.5 and will be removed in '
345-
'Python 3.7')
343+
'deprecated in Python 3.5')
346344

347345
if __name__ == '__main__':
348346
unittest.main()

Misc/NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,10 @@ Core and Builtins
256256
Library
257257
-------
258258

259+
- Issue #26041: Remove "will be removed in Python 3.7" from deprecation
260+
messages of platform.dist() and platform.linux_distribution().
261+
Patch by Kumaripaba Miyurusara Athukorala.
262+
259263
- Issue #26822: itemgetter, attrgetter and methodcaller objects no longer
260264
silently ignore keyword arguments.
261265

0 commit comments

Comments
 (0)