Sfoglia il codice sorgente

Handle broken pipe on stdout

master
JustAnotherArchivist 4 anni fa
parent
commit
5c907488e1
1 ha cambiato i file con 4 aggiunte e 1 eliminazioni
  1. +4
    -1
      s3-bucket-list

+ 4
- 1
s3-bucket-list Vedi File

@@ -96,7 +96,10 @@ while True:

size = int(fields['Size']) if 'Size' in fields else None

print(format.format(**fields, key = key, url = url, size = size))
try:
print(format.format(**fields, key = key, url = url, size = size))
except BrokenPipeError:
sys.exit(0)
lastKey = key

truncated = True if b'<IsTruncated>true</IsTruncated>' in body else (False if b'<IsTruncated>false</IsTruncated>' in body else None)


Caricamento…
Annulla
Salva