PSSH: Merge some collapsible if statements
This commit is contained in:
parent
7436c60d00
commit
f0df2f4490
|
@ -108,13 +108,11 @@ class PSSH:
|
||||||
flags: int = 0
|
flags: int = 0
|
||||||
) -> PSSH:
|
) -> PSSH:
|
||||||
"""Craft a new version 0 or 1 PSSH Box."""
|
"""Craft a new version 0 or 1 PSSH Box."""
|
||||||
if key_ids is not None:
|
if key_ids is not None and not isinstance(key_ids, list):
|
||||||
if not isinstance(key_ids, list):
|
raise TypeError(f"Expected key_ids to be a list not {key_ids!r}")
|
||||||
raise TypeError(f"Expected key_ids to be a list not {key_ids!r}")
|
|
||||||
|
|
||||||
if init_data is not None:
|
if init_data is not None and not isinstance(init_data, (WidevinePsshData, str, bytes)):
|
||||||
if not isinstance(init_data, (WidevinePsshData, str, bytes)):
|
raise TypeError(f"Expected init_data to be a {WidevinePsshData}, base64, or bytes, not {init_data!r}")
|
||||||
raise TypeError(f"Expected init_data to be a {WidevinePsshData}, base64, or bytes, not {init_data!r}")
|
|
||||||
|
|
||||||
if not isinstance(version, int):
|
if not isinstance(version, int):
|
||||||
raise TypeError(f"Expected version to be an int not {version!r}")
|
raise TypeError(f"Expected version to be an int not {version!r}")
|
||||||
|
|
Loading…
Reference in New Issue