Skip to content

Commit

Permalink
Add more specific exception: ImportError
Browse files Browse the repository at this point in the history
  • Loading branch information
mdeweerd committed Aug 1, 2024
1 parent f72a7fa commit 2ba1ba9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions custom_components/zha_toolkit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

try:
from homeassistant.components.zha import Gateway as ZHAGateway
except:
except ImportError:
from homeassistant.components.zha.core.gateway import ZHAGateway

from homeassistant.util import dt as dt_util
from zigpy import types as t
from zigpy.exceptions import DeliveryError
Expand Down
2 changes: 1 addition & 1 deletion custom_components/zha_toolkit/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

try:
from homeassistant.components.zha import Gateway as ZHAGateway
except:
except ImportError:
from homeassistant.components.zha.core.gateway import ZHAGateway

from homeassistant.util import dt as dt_util
Expand Down

0 comments on commit 2ba1ba9

Please sign in to comment.