mirror of
https://cdm-project.com/Download-Tools/udemy-downloader.git
synced 2025-05-06 16:54:28 +02:00
fix some issues with subprocess logging
This commit is contained in:
parent
e5398a1333
commit
2ce865a81b
2
main.py
2
main.py
@ -53,7 +53,7 @@ is_subscription_course = False
|
|||||||
# from https://stackoverflow.com/a/21978778/9785713
|
# from https://stackoverflow.com/a/21978778/9785713
|
||||||
def log_subprocess_output(prefix: str, pipe: IO[bytes]):
|
def log_subprocess_output(prefix: str, pipe: IO[bytes]):
|
||||||
if pipe:
|
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())
|
logger.debug('[%s]: %r', prefix, line.decode("utf8").strip())
|
||||||
pipe.flush()
|
pipe.flush()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user