Commit e50d8465 authored by Berker Peksag's avatar Berker Peksag

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.
parents 8d9594df 8d8221f0
...@@ -2271,9 +2271,8 @@ class has been deprecated. ...@@ -2271,9 +2271,8 @@ class has been deprecated.
(Contributed by Serhiy Storchaka in :issue:`23671`.) (Contributed by Serhiy Storchaka in :issue:`23671`.)
The :func:`platform.dist` and :func:`platform.linux_distribution` functions The :func:`platform.dist` and :func:`platform.linux_distribution` functions
are now deprecated and will be removed in Python 3.7. Linux distributions use are now deprecated. Linux distributions use too many different ways of
too many different ways of describing themselves, so the functionality is describing themselves, so the functionality is left to a package.
left to a package.
(Contributed by Vajrasky Kok and Berker Peksag in :issue:`1322`.) (Contributed by Vajrasky Kok and Berker Peksag in :issue:`1322`.)
The previously undocumented ``from_function`` and ``from_builtin`` methods of The previously undocumented ``from_function`` and ``from_builtin`` methods of
......
...@@ -303,8 +303,7 @@ def linux_distribution(distname='', version='', id='', ...@@ -303,8 +303,7 @@ def linux_distribution(distname='', version='', id='',
full_distribution_name=1): full_distribution_name=1):
import warnings import warnings
warnings.warn("dist() and linux_distribution() functions are deprecated " warnings.warn("dist() and linux_distribution() functions are deprecated "
"in Python 3.5 and will be removed in Python 3.7", "in Python 3.5", PendingDeprecationWarning, stacklevel=2)
PendingDeprecationWarning, stacklevel=2)
return _linux_distribution(distname, version, id, supported_dists, return _linux_distribution(distname, version, id, supported_dists,
full_distribution_name) full_distribution_name)
...@@ -378,8 +377,7 @@ def dist(distname='', version='', id='', ...@@ -378,8 +377,7 @@ def dist(distname='', version='', id='',
""" """
import warnings import warnings
warnings.warn("dist() and linux_distribution() functions are deprecated " warnings.warn("dist() and linux_distribution() functions are deprecated "
"in Python 3.5 and will be removed in Python 3.7", "in Python 3.5", PendingDeprecationWarning, stacklevel=2)
PendingDeprecationWarning, stacklevel=2)
return _linux_distribution(distname, version, id, return _linux_distribution(distname, version, id,
supported_dists=supported_dists, supported_dists=supported_dists,
full_distribution_name=0) full_distribution_name=0)
......
...@@ -333,16 +333,14 @@ class DeprecationTest(unittest.TestCase): ...@@ -333,16 +333,14 @@ class DeprecationTest(unittest.TestCase):
platform.dist() platform.dist()
self.assertEqual(str(cm.warning), self.assertEqual(str(cm.warning),
'dist() and linux_distribution() functions are ' 'dist() and linux_distribution() functions are '
'deprecated in Python 3.5 and will be removed in ' 'deprecated in Python 3.5')
'Python 3.7')
def test_linux_distribution_deprecation(self): def test_linux_distribution_deprecation(self):
with self.assertWarns(PendingDeprecationWarning) as cm: with self.assertWarns(PendingDeprecationWarning) as cm:
platform.linux_distribution() platform.linux_distribution()
self.assertEqual(str(cm.warning), self.assertEqual(str(cm.warning),
'dist() and linux_distribution() functions are ' 'dist() and linux_distribution() functions are '
'deprecated in Python 3.5 and will be removed in ' 'deprecated in Python 3.5')
'Python 3.7')
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
...@@ -256,6 +256,10 @@ Core and Builtins ...@@ -256,6 +256,10 @@ Core and Builtins
Library Library
------- -------
- Issue #26041: Remove "will be removed in Python 3.7" from deprecation
messages of platform.dist() and platform.linux_distribution().
Patch by Kumaripaba Miyurusara Athukorala.
- Issue #26822: itemgetter, attrgetter and methodcaller objects no longer - Issue #26822: itemgetter, attrgetter and methodcaller objects no longer
silently ignore keyword arguments. silently ignore keyword arguments.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment