Przeglądaj źródła

Handle broken pipe on stdout

master
JustAnotherArchivist 4 lat temu
rodzic
commit
5c907488e1
1 zmienionych plików z 4 dodań i 1 usunięć
  1. +4
    -1
      s3-bucket-list

+ 4
- 1
s3-bucket-list Wyświetl plik

@@ -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)


Ładowanie…
Anuluj
Zapisz