Improve typechecking message

This commit is contained in:
Florian Bruhin 2017-06-13 14:51:32 +02:00
parent 500ad8b00f
commit 269e9d69e0

View File

@ -122,8 +122,8 @@ class BaseType:
if (value is not None and pytype is not None and
not isinstance(value, pytype)):
raise configexc.ValidationError(
value, "expected a value of type {} but got {}".format(
pytype, type(value)))
value, "expected a value of type {} but got {}.".format(
pytype.__name__, type(value).__name__))
if isinstance(value, str):
if not value and not self.none_ok: