fix some issues with subprocess logging

This commit is contained in:
Puyodead1 2022-07-10 08:41:03 -04:00
parent e5398a1333
commit 2ce865a81b
No known key found for this signature in database
GPG Key ID: 4544A2432AFC803A

View File

@ -53,7 +53,7 @@ is_subscription_course = False
# from https://stackoverflow.com/a/21978778/9785713
def log_subprocess_output(prefix: str, pipe: IO[bytes]):
if pipe:
for line in iter(pipe.readline, b''): # b'\n'-separated lines
for line in iter(lambda: pipe.read(1), ""):
logger.debug('[%s]: %r', prefix, line.decode("utf8").strip())
pipe.flush()