Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle AttributeError by raising DistutilsSetupError in check_specifier. Fixes #1932 #2583

Merged
merged 3 commits into from
Feb 28, 2021

Conversation

melissa-kun-li
Copy link
Contributor

@melissa-kun-li melissa-kun-li commented Feb 28, 2021

Summary of changes

Closes #1932

Dist.check_specifier verifies that the specifiers are valid and raises DistutilsSetupError if found invalid, however in the situation that the specifier is a non-string (e.g. a list with a string element) it would fail with an AttributeError because SpecifierSet from _vendor/packaging will assume that the specifier is a string. This fix will change check_specifier to handle the AttributeError by raising DistutilsSetupError when the situation of a non-string specifier occurs.

Pull Request Checklist

@melissa-kun-li melissa-kun-li changed the title Check specifier handle error Handle AttributeError by raising DistutilsSetupError in check_specifier. Fixes #1932 Feb 28, 2021
@jaraco
Copy link
Member

jaraco commented Feb 28, 2021

This looks perfect. Thanks!

@jaraco jaraco merged commit 0c63d16 into pypa:main Feb 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

check_specifier() raises an exception when not passed as string
2 participants