Skip to content

Commit d6662a2

Browse files
Potential fix for pull request finding 'Empty except'
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
1 parent b02ae2c commit d6662a2

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/session/discovery.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,11 @@ async def start_session(self, config: dict | None = None):
151151
self.auth.device_group_key = config["device_data"][0]
152152
self.auth.device_key = config["device_data"][1]
153153
self.auth.device_password = config["device_data"][2]
154-
try:
155-
token_created = config["device_data"][3]
154+
device_data = config["device_data"]
155+
if len(device_data) > 3:
156+
token_created = device_data[3]
156157
if token_created:
157158
self.tokens.token_created = token_created # type: ignore[attr-defined]
158-
except IndexError:
159-
pass
160159

161160
if not self.config.file and "tokens" not in config:
162161
raise HiveUnknownConfiguration

0 commit comments

Comments
 (0)