Skip to content

Commit ba3faf7

Browse files
SanderGidevxpy
authored andcommitted
raise_for_status instead of custom error message
1 parent 0da6b33 commit ba3faf7

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

retro/sadtalker.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,7 @@ def fixed_generate_blink_seq_randomly(num_frames):
5858
def urlretrieve(url, filename):
5959
"""Same as urllib.urlretrieve but uses requests because urllib breaks on discord attachments. Does not support data: URLs and local files."""
6060
res = requests.get(url)
61-
if not res.ok:
62-
raise ValueError(
63-
f"Could not access user provided url: {url} ({res.status_code} {res.reason}"
64-
)
61+
res.raise_for_status()
6562
with open(filename, "wb") as f:
6663
f.write(res.content)
6764
return filename, None

0 commit comments

Comments
 (0)