-
Notifications
You must be signed in to change notification settings - Fork 236
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
PyInquirer\prompts\input.py", line 20 TypeError: issubclass() arg 1 must be a class #19
Comments
def question(message, **kwargs):
default = kwargs.pop('default', '')
validate_prompt = kwargs.pop('validate', None)
if validate_prompt:
if callable(validate_prompt):
class _InputValidator(Validator):
def validate(self, document):
verdict = validate_prompt(document.text)
if not verdict == True:
if verdict == False:
verdict = 'invalid input'
raise ValidationError(
message=verdict,
cursor_position=len(document.text))
kwargs['validator'] = _InputValidator()
elif issubclass(validate_prompt, Validator):
kwargs['validator'] = validate_prompt() check callable first, then issubclass |
Hello @vc1, sorry for late reply and thanks for pointing this out. Can you make this a PR instead? |
This does not work, as the |
The issue has been fixed and the fix is merged |
Hello, I'm having this exact same problem when trying to run the example code |
The text was updated successfully, but these errors were encountered: