-
Notifications
You must be signed in to change notification settings - Fork 887
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
Fix #1603, add closest predicate name in error message #3054
Fix #1603, add closest predicate name in error message #3054
Conversation
@@ -152,7 +152,16 @@ def make(self, config, **kw): | |||
weights.append(1 << n + 1) | |||
preds.append(pred) | |||
if kw: | |||
raise ConfigurationError('Unknown predicate values: %r' % (kw,)) | |||
from difflib import get_close_matches |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment for future reviewers, import statement inside the function so that we only have to import it when we are about to raise a ConfigurationError
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool, thank you @fangpenlin!
Wow! :D |
Fix #1603, add closest predicate name in error message