From be482c08d880b279b18081719c2536bc03f785cf Mon Sep 17 00:00:00 2001 From: hyugogirubato <65763543+hyugogirubato@users.noreply.github.com> Date: Mon, 8 Jul 2024 19:02:52 +0200 Subject: [PATCH] Fix challenge file arg support --- keydive/cdm.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/keydive/cdm.py b/keydive/cdm.py index d9e4eeb..b50c5db 100644 --- a/keydive/cdm.py +++ b/keydive/cdm.py @@ -86,12 +86,12 @@ class Cdm: Args: data (Union[Path, bytes]): The challenge data as a file path or bytes. """ - try: - if isinstance(data, Path): - if not data.is_file(): - raise FileNotFoundError(data) - data = data.read_bytes() + if isinstance(data, Path): + if not data.is_file(): + raise FileNotFoundError(data) + data = data.read_bytes() + try: signed_message = SignedMessage() signed_message.ParseFromString(data)