mirror of
https://github.com/TinyTapeout/tt-support-tools.git
synced 2026-11-03 04:36:09 +01:00
if file is 0 bytes, return false
This commit is contained in:
@@ -44,6 +44,10 @@ def fetch_file(url, filename):
|
|||||||
logging.warning("couldn't download {}".format(url))
|
logging.warning("couldn't download {}".format(url))
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
if len(r.content) == 0:
|
||||||
|
logging.warning("file was 0 bytes {}".format(url))
|
||||||
|
return False
|
||||||
|
|
||||||
with open(filename, 'wb') as fh:
|
with open(filename, 'wb') as fh:
|
||||||
logging.info("written to {}".format(filename))
|
logging.info("written to {}".format(filename))
|
||||||
fh.write(r.content)
|
fh.write(r.content)
|
||||||
|
|||||||
Reference in New Issue
Block a user