From 8f2f9f5d47f11da6116612436785fd5141325d89 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sun, 8 Sep 2024 13:08:08 -0400 Subject: [PATCH] keyboard.py: allow 'import usb_hid' to fail --- .pre-commit-config.yaml | 2 +- adafruit_hid/keyboard.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 70ade69..2f49848 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,7 +18,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/pycqa/pylint - rev: v2.17.4 + rev: v3.2.7 hooks: - id: pylint name: pylint (library code) diff --git a/adafruit_hid/keyboard.py b/adafruit_hid/keyboard.py index db7079e..425a9f4 100644 --- a/adafruit_hid/keyboard.py +++ b/adafruit_hid/keyboard.py @@ -10,7 +10,6 @@ """ from micropython import const -import usb_hid from .keycode import Keycode @@ -18,7 +17,8 @@ try: from typing import Sequence -except: # pylint: disable=bare-except + import usb_hid +except ImportError: pass _MAX_KEYPRESSES = const(6)