diff --git a/importlib_metadata/__init__.py b/importlib_metadata/__init__.py index 9a673358..c35fe108 100644 --- a/importlib_metadata/__init__.py +++ b/importlib_metadata/__init__.py @@ -477,7 +477,7 @@ def _discover_resolvers(): return filter(None, declared) @property - @apply(localize.metadata) + @apply(localize.message) def metadata(self) -> _meta.PackageMetadata: """Return the parsed metadata for this Distribution. diff --git a/importlib_metadata/_compat/localize.py b/importlib_metadata/_compat/localize.py index 9062ff01..d90da1a3 100644 --- a/importlib_metadata/_compat/localize.py +++ b/importlib_metadata/_compat/localize.py @@ -27,7 +27,7 @@ def dist( return cast(importlib_metadata.Distribution, dist) -def metadata( +def message( input: importlib_metadata._adapters.Message | email.message.Message, ) -> importlib_metadata._adapters.Message: if isinstance(input, importlib_metadata._adapters.Message):