mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
build/generic_programmer: catch 404 not found when downloading config/proxy.
This commit is contained in:
parent
d0b8daa005
commit
9a7f9cb87b
1 changed files with 8 additions and 6 deletions
|
@ -47,9 +47,10 @@ class GenericProgrammer:
|
|||
fullname = tools.cygpath(os.path.join(self.prog_local, self.flash_proxy_basename))
|
||||
try:
|
||||
r = requests.get(d + self.flash_proxy_basename)
|
||||
with open(fullname, "wb") as f:
|
||||
f.write(r.content)
|
||||
return fullname
|
||||
if r.status_code != 404:
|
||||
with open(fullname, "wb") as f:
|
||||
f.write(r.content)
|
||||
return fullname
|
||||
except:
|
||||
pass
|
||||
raise OSError("Failed to find flash proxy bitstream")
|
||||
|
@ -70,9 +71,10 @@ class GenericProgrammer:
|
|||
fullname = tools.cygpath(os.path.join(self.prog_local, self.config))
|
||||
try:
|
||||
r = requests.get(d + self.config)
|
||||
with open(fullname, "wb") as f:
|
||||
f.write(r.content)
|
||||
return fullname
|
||||
if r.status_code != 404:
|
||||
with open(fullname, "wb") as f:
|
||||
f.write(r.content)
|
||||
return fullname
|
||||
except:
|
||||
pass
|
||||
raise OSError("Failed to find config file")
|
||||
|
|
Loading…
Reference in a new issue