catch exception on closed inputs

This commit is contained in:
Jakob Ketterl 2020-08-08 20:43:29 +02:00
parent 031c937c0c
commit ef2ec1e1c5

View File

@ -54,7 +54,11 @@ class output(object):
def copy():
run = True
while run:
data = None
try:
data = read()
except ValueError:
pass
if data is None or (isinstance(data, bytes) and len(data) == 0):
run = False
else: