]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-44464: Remove special exclusion for flake8 in the deprecation warnings. (GH-26807...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 27 Jun 2021 22:19:24 +0000 (15:19 -0700)
committerGitHub <noreply@github.com>
Sun, 27 Jun 2021 22:19:24 +0000 (18:19 -0400)
Sync with importlib_metadata 4.6.
(cherry picked from commit efe7d08d178a7c09bcca994f2068b019c8633d83)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Doc/whatsnew/3.10.rst
Lib/importlib/metadata/__init__.py
Misc/NEWS.d/next/Library/2021-06-19-21-52-27.bpo-44464.U2oa-a.rst [new file with mode: 0644]

index 6b6578b4097f3f0d6aa68ff041d326822350b514..7ed80fb903efd1325f5fa5b4b17dd5083a35ad9c 100644 (file)
@@ -1084,7 +1084,7 @@ and will be incorrect in some rare cases, including some ``_``-s in
 importlib.metadata
 ------------------
 
-Feature parity with ``importlib_metadata`` 4.4
+Feature parity with ``importlib_metadata`` 4.6
 (`history <https://importlib-metadata.readthedocs.io/en/latest/history.html>`_).
 
 :ref:`importlib.metadata entry points <entry-points>`
index d2116cfe6f7d655471f2edf26dfb145f3833bcc7..f5172eefc184111414f4ec0c26d8f897e0fb105c 100644 (file)
@@ -362,14 +362,6 @@ class EntryPoints(DeprecatedList):
         )
 
 
-def flake8_bypass(func):
-    # defer inspect import as performance optimization.
-    import inspect
-
-    is_flake8 = any('flake8' in str(frame.filename) for frame in inspect.stack()[:5])
-    return func if not is_flake8 else lambda: None
-
-
 class Deprecated:
     """
     Compatibility add-in for mapping to indicate that
@@ -405,7 +397,7 @@ class Deprecated:
         return super().__getitem__(name)
 
     def get(self, name, default=None):
-        flake8_bypass(self._warn)()
+        self._warn()
         return super().get(name, default)
 
     def __iter__(self):
diff --git a/Misc/NEWS.d/next/Library/2021-06-19-21-52-27.bpo-44464.U2oa-a.rst b/Misc/NEWS.d/next/Library/2021-06-19-21-52-27.bpo-44464.U2oa-a.rst
new file mode 100644 (file)
index 0000000..6b1c107
--- /dev/null
@@ -0,0 +1,2 @@
+Remove exception for flake8 in deprecated importlib.metadata interfaces.
+Sync with importlib_metadata 4.6.