From ebf48be0ad85d044d80331edf3c5b6abb3a4cd14 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 22 Aug 2019 08:36:14 +1000 Subject: [PATCH] wacom: replace the last exception with a protocol exception Signed-off-by: Peter Hutterer --- tuhi/wacom.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tuhi/wacom.py b/tuhi/wacom.py index 02f78ca..76485f1 100644 --- a/tuhi/wacom.py +++ b/tuhi/wacom.py @@ -18,7 +18,6 @@ import logging import threading import time import uuid -import errno from pathlib import Path from gi.repository import GObject from .drawing import Drawing @@ -246,10 +245,6 @@ class DataLogger(object): self.logfile.write(f' source: {source}\n') -class WacomException(Exception): - errno = errno.ENOSYS - - class WacomPacket(GObject.Object): ''' A single protocol packet of variable length. The protocol format is a @@ -421,7 +416,7 @@ class WacomRegisterHelper(WacomProtocolLowLevelComm): protocol_version = self.p.execute(Interactions.REGISTER_WAIT_FOR_BUTTON).protocol_version if protocol_version == ProtocolVersion.ANY: - raise WacomException(f'Unknown protocol version: {protocol_version}') + raise tuhi.protocol.ProtocolError(f'Unknown protocol version: {protocol_version}') return protocol_version @@ -1020,7 +1015,7 @@ class WacomDevice(GObject.Object): self.sync_state = 1 self._wacom_protocol.retrieve_data() self.sync_state = 0 - except WacomException as e: + except DeviceError as e: logger.error(f'**** Exception: {e} ****') exception = e self.sync_state = 0