Improve error message for PercOrInt

Fixes #3068
This commit is contained in:
Florian Bruhin 2017-10-08 19:47:05 +02:00
parent 6c3f90146f
commit 8c1e95787d

View File

@ -828,7 +828,8 @@ class PercOrInt(_Numeric):
if isinstance(value, str):
if not value.endswith('%'):
raise configexc.ValidationError(value, "does not end with %")
raise configexc.ValidationError(
value, "needs to end with % or be an integer")
try:
intval = int(value[:-1])