Skip to content

Commit

Permalink
Fix return value check for subprocess.run (ultralytics#10972)
Browse files Browse the repository at this point in the history
Subprocess.run does not return an integer.

Regressed in ultralytics#10944
  • Loading branch information
akx authored Feb 13, 2023
1 parent fa4bdbe commit 1a2eb53
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,8 +631,8 @@ def download_one(url, dir):
for i in range(retry + 1):
if curl:
s = 'sS' if threads > 1 else '' # silent
r = subprocess.run(f'curl -# -{s}L "{url}" -o "{f}" --retry 9 -C -'.split())
success = r == 0
proc = subprocess.run(f'curl -# -{s}L "{url}" -o "{f}" --retry 9 -C -'.split())
success = proc.returncode == 0
else:
torch.hub.download_url_to_file(url, f, progress=threads == 1) # torch download
success = f.is_file()
Expand Down

0 comments on commit 1a2eb53

Please sign in to comment.