Explorar el Código

Handle broken pipe on stdout

master
JustAnotherArchivist hace 4 años
padre
commit
5c907488e1
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. +4
    -1
      s3-bucket-list

+ 4
- 1
s3-bucket-list Ver fichero

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


Cargando…
Cancelar
Guardar