Fix challenge file arg support
This commit is contained in:
parent
349b33dc64
commit
be482c08d8
|
@ -86,12 +86,12 @@ class Cdm:
|
||||||
Args:
|
Args:
|
||||||
data (Union[Path, bytes]): The challenge data as a file path or bytes.
|
data (Union[Path, bytes]): The challenge data as a file path or bytes.
|
||||||
"""
|
"""
|
||||||
try:
|
|
||||||
if isinstance(data, Path):
|
if isinstance(data, Path):
|
||||||
if not data.is_file():
|
if not data.is_file():
|
||||||
raise FileNotFoundError(data)
|
raise FileNotFoundError(data)
|
||||||
data = data.read_bytes()
|
data = data.read_bytes()
|
||||||
|
|
||||||
|
try:
|
||||||
signed_message = SignedMessage()
|
signed_message = SignedMessage()
|
||||||
signed_message.ParseFromString(data)
|
signed_message.ParseFromString(data)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue