Skip to content

Commit 6a88177

Browse files
authored
Merge pull request #20 from davidlj95/patch-1
Fix bug when input validator is a callable
2 parents d7de28b + 6613ece commit 6a88177

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

PyInquirer/prompts/input.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"""
33
`input` type question
44
"""
5+
import inspect
56
from __future__ import print_function, unicode_literals
67
from prompt_toolkit.token import Token
78
from prompt_toolkit.shortcuts import create_prompt_application
@@ -17,7 +18,7 @@ def question(message, **kwargs):
1718
default = kwargs.pop('default', '')
1819
validate_prompt = kwargs.pop('validate', None)
1920
if validate_prompt:
20-
if issubclass(validate_prompt, Validator):
21+
if inspect.isclass(validate_prompt) and issubclass(validate_prompt, Validator):
2122
kwargs['validator'] = validate_prompt()
2223
elif callable(validate_prompt):
2324
class _InputValidator(Validator):

0 commit comments

Comments
 (0)