debian/lib/python/debian_linux/config.py: Fix undefined exception type

SchemaItemBoolean and SchemaItemInteger attempt to raise an exception
of type Error when given invalid input, but this type has never been
defined.  Use ValueError instead.
This commit is contained in:
Ben Hutchings
2018-10-01 22:02:33 +01:00
parent 8b0aacdc26
commit ee1d2b9dff
2 changed files with 3 additions and 5 deletions

View File

@@ -21,15 +21,12 @@ class SchemaItemBoolean(object):
return True
if i in ("false", "0"):
return False
raise Error
raise ValueError
class SchemaItemInteger(object):
def __call__(self, i):
try:
return int(i.strip(), 0)
except ValueError:
raise Error
return int(i.strip(), 0)
class SchemaItemList(object):