From c428a57352138d01c21064012091b9bde3017060 Mon Sep 17 00:00:00 2001 From: Anderson Bravalheri Date: Tue, 14 Feb 2023 07:52:17 +0000 Subject: [PATCH] Fix error when integrating with pip --- setuptools/command/egg_info.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index afcde5a2a1..e40df9bba7 100644 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -250,7 +250,8 @@ def finalize_options(self): # to the version info # pd = self.distribution._patched_dist - if pd is not None and pd.key == self.egg_name.lower(): + key = getattr(pd, "key", None) or getattr(pd, "name", None) + if pd is not None and key == self.egg_name.lower(): pd._version = self.egg_version pd._parsed_version = packaging.version.Version(self.egg_version) self.distribution._patched_dist = None