This is an automated email from the ASF dual-hosted git repository.

juergbi pushed a commit to branch juerg/update-fixes
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit 097a249b37ecfc425a84d6c79a81b21e5ccfea6f
Author: Jürg Billeter <[email protected]>
AuthorDate: Fri Jul 26 14:36:07 2024 +0200

    pluginoriginpip.py: Fix exception name for setuptools 70
---
 src/buildstream/_pluginfactory/pluginoriginpip.py | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/buildstream/_pluginfactory/pluginoriginpip.py 
b/src/buildstream/_pluginfactory/pluginoriginpip.py
index a50534f60..b9f9d2b85 100644
--- a/src/buildstream/_pluginfactory/pluginoriginpip.py
+++ b/src/buildstream/_pluginfactory/pluginoriginpip.py
@@ -32,6 +32,7 @@ class PluginOriginPip(PluginOrigin):
 
     def get_plugin_paths(self, kind, plugin_type):
 
+        import packaging
         import pkg_resources
 
         # Sources and elements are looked up in separate
@@ -62,12 +63,7 @@ class PluginOriginPip(PluginOrigin):
                 detail=e.report(),
                 reason="package-version-conflict",
             ) from e
-        except (
-            # For setuptools < 49.0.0
-            pkg_resources.RequirementParseError,
-            # For setuptools >= 49.0.0
-            pkg_resources.extern.packaging.requirements.InvalidRequirement,
-        ) as e:
+        except packaging.requirements.InvalidRequirement as e:
             raise PluginError(
                 "{}: Malformed package-name '{}' encountered: {}".format(
                     self.provenance_node.get_provenance(), self._package_name, 
e

Reply via email to