Skip to content

Commit 6673723

Browse files
AA-Turnerjaraco
andcommitted
GH-109653: Defer import of importlib.metadata._adapters (python/cpython#109829)
--------- Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
1 parent f5d6b5f commit 6673723

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

importlib_metadata/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import posixpath
1919
import collections
2020

21-
from . import _adapters, _meta
21+
from . import _meta
2222
from .compat import py39
2323
from ._collections import FreezableDefaultDict, Pair
2424
from ._compat import (
@@ -461,6 +461,9 @@ def metadata(self) -> _meta.PackageMetadata:
461461
Custom providers may provide the METADATA file or override this
462462
property.
463463
"""
464+
# deferred for performance (python/cpython#109829)
465+
from . import _adapters
466+
464467
opt_text = (
465468
self.read_text('METADATA')
466469
or self.read_text('PKG-INFO')

newsfragments/+.feature.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Deferred select imports in for speedup (python/cpython#109829).

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy