]> granicus.if.org Git - python/commitdiff
bpo-28167: bump platform.linux_distribution removal to 3.8 (GH-6669)
authorMatthias Bussonnier <bussonniermatthias@gmail.com>
Tue, 15 May 2018 15:17:00 +0000 (08:17 -0700)
committerPetr Viktorin <encukou@gmail.com>
Tue, 15 May 2018 15:17:00 +0000 (11:17 -0400)
Also bump PendingDeprecationWarning to DeprecationWarning.

Doc/library/platform.rst
Lib/platform.py
Lib/test/test_platform.py
Misc/NEWS.d/next/Library/2018-05-02-07-26-29.bpo-28167.7FwDfN.rst [new file with mode: 0644]

index eea0abbae4d41eb968ca508a7ac553eb6df2c6c9..f5cb52cb4745b4cf2d8049cf20b0e53a2906c50e 100644 (file)
@@ -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)
 
@@ -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)
 
index dc981ec144cc0719cd0ebed21ca85c8c8a1b50eb..20f9817f4ffb49d09462fbc61bfa1cd0237f9dcf 100755 (executable)
@@ -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)
 
@@ -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)
@@ -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:
index 2cf4d3f5dfdb64e187eec946301dbf4498a98edb..5f1e28a5d950bb2792bac4dbf2bc2dc4c819eb8d 100644 (file)
@@ -353,14 +353,14 @@ class PlatformTest(unittest.TestCase):
 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 '
diff --git a/Misc/NEWS.d/next/Library/2018-05-02-07-26-29.bpo-28167.7FwDfN.rst b/Misc/NEWS.d/next/Library/2018-05-02-07-26-29.bpo-28167.7FwDfN.rst
new file mode 100644 (file)
index 0000000..a4971e5
--- /dev/null
@@ -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