diff --git a/setuptools/dist.py b/setuptools/dist.py index c31020f0c4..6ae3886b1f 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -292,7 +292,7 @@ def check_specifier(dist, attr, value): """Verify that value is a valid version specifier""" try: packaging.specifiers.SpecifierSet(value) - except packaging.specifiers.InvalidSpecifier as error: + except (packaging.specifiers.InvalidSpecifier, AttributeError) as error: tmpl = ( "{attr!r} must be a string " "containing valid version specifiers; {error}"