]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
acpi-update.py: there is no "Error" class
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 1 Dec 2016 22:23:53 +0000 (17:23 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 1 Dec 2016 23:52:57 +0000 (18:52 -0500)
Evidently this code path was never hit, because we'd crash with NameError.
The exception message also seems bogus. So just replace the whole thing
with the standard exception for invalid input.

hwdb/acpi-update.py

index 2dc8c7c064eb33d3d69b52b4aa7a19973891e497..50da531dc659de9d189a9f9deae0caa2c14c722e 100755 (executable)
@@ -31,7 +31,7 @@ class PNPTableParser(HTMLParser):
             elif self.state == State.AFTER_PNPID:
                 self.state = State.DATE
             else:
-                raise Error("Unexpected field")
+                raise ValueError
 
             self.data = ""
 
@@ -48,7 +48,7 @@ class PNPTableParser(HTMLParser):
             elif self.state == State.DATE:
                 self.state = State.NOWHERE
             else:
-                raise Error("Unexpected field")
+                raise ValueError
 
     def handle_data(self, data):
         self.data += data