aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2018-10-01 22:02:33 +0100
committerBen Hutchings <ben@decadent.org.uk>2018-10-01 22:02:33 +0100
commitee1d2b9dff7bc5d7d3502ca85d1aaa765aa9fc98 (patch)
treec8bda89e44d303a4f098d7fbe2891f7247920e00
parent8b0aacdc260f03762e2c20389b302466d8910fc2 (diff)
downloadkernel_replicant_linux-ee1d2b9dff7bc5d7d3502ca85d1aaa765aa9fc98.tar.gz
kernel_replicant_linux-ee1d2b9dff7bc5d7d3502ca85d1aaa765aa9fc98.tar.bz2
kernel_replicant_linux-ee1d2b9dff7bc5d7d3502ca85d1aaa765aa9fc98.zip
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.
-rw-r--r--debian/changelog1
-rw-r--r--debian/lib/python/debian_linux/config.py7
2 files changed, 3 insertions, 5 deletions
diff --git a/debian/changelog b/debian/changelog
index 1581798bce2e..1b49c27f53d5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,7 @@ linux (4.19~rc6-1~exp1) UNRELEASED; urgency=medium
* debian/bin, debian/lib/python: Clean up imports based on pyflakes report
* debian/bin, debian/lib/python: Delete write-only vars reported by pyflakes
* debian/lib/python/debian_linux/gencontrol.py: Delete broken methods
+ * debian/lib/python/debian_linux/config.py: Fix undefined exception type
-- Ben Hutchings <ben@decadent.org.uk> Thu, 20 Sep 2018 02:40:54 +0100
diff --git a/debian/lib/python/debian_linux/config.py b/debian/lib/python/debian_linux/config.py
index 741a9cd3e0cb..37e3764ab0f1 100644
--- a/debian/lib/python/debian_linux/config.py
+++ b/debian/lib/python/debian_linux/config.py
@@ -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):