From 4b4b0918e708d4331a9beaa42be6cd12fd9c18a8 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 11 Sep 2024 12:42:20 -0400 Subject: [PATCH] Stop trying to differentiate between importlib.metadata._adapters.Message and email.message.Message. --- importlib_metadata/_compat.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/importlib_metadata/_compat.py b/importlib_metadata/_compat.py index 128d35e9..e242e3ce 100644 --- a/importlib_metadata/_compat.py +++ b/importlib_metadata/_compat.py @@ -81,14 +81,8 @@ def localize_dist( return cast(importlib_metadata.Distribution, dist) -if sys.version_info >= (3, 10): - StdlibMessage = importlib.metadata._adapters.Message -else: - StdlibMessage = email.message.Message - - def localize_metadata( - input: importlib_metadata._adapters.Message | StdlibMessage, + input: importlib_metadata._adapters.Message | email.message.Message, ) -> importlib_metadata._adapters.Message: if isinstance(input, importlib_metadata._adapters.Message): return input