diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2019-05-16 14:16:22 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2019-05-16 14:16:22 -0300 |
commit | a88469c6d770e61577ee7408778baef20bddf31b (patch) | |
tree | d031c1a517f27987eebd84bac8bdc7eeba8252ba | |
parent | 060975ed25259cf19d3a7f4ef288fc35c64148ed (diff) | |
download | ckandumper-a88469c6d770e61577ee7408778baef20bddf31b.tar.gz ckandumper-a88469c6d770e61577ee7408778baef20bddf31b.tar.bz2 |
Check if file exists before attempt to get sha256sum
-rwxr-xr-x | ckandumper | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -94,10 +94,11 @@ class DownloadMultiple: output.write(str(datetime.datetime.now()) + '\n') output.close() - content = open(local_filename, 'rb') - output = open(local_filename + '.sha256', 'w') - output.write(sha256(content.read()).hexdigest() + ' ' + os.path.basename(local_filename) + '\n') - output.close() + if os.path.exists(local_filename): + content = open(local_filename, 'rb') + output = open(local_filename + '.sha256', 'w') + output.write(sha256(content.read()).hexdigest() + ' ' + os.path.basename(local_filename) + '\n') + output.close() if not str(proc.returncode) in self.globalstats['exitstatus']: self.globalstats['exitstatus'][str(proc.returncode)] = [] |