Skip to content

Commit

Permalink
check empty line after polling rather than at caller
Browse files Browse the repository at this point in the history
  • Loading branch information
Umit Kablan committed Oct 3, 2024
1 parent 05f1e92 commit 0911232
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 1 addition & 2 deletions pleskdistup/common/src/dpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@ def process_stdout(line: str) -> None:
log.info(line)

def process_stderr(line: str) -> None:
if line:
log.err(line)
log.err(line)
nonlocal cant_get_lock
if cant_get_lock:
return
Expand Down
6 changes: 4 additions & 2 deletions pleskdistup/common/src/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,13 @@ def exec_get_output_streamed(
if not process.stdout:
raise RuntimeError(f"Cannot get process stdout of command {cmd!r}")
line = process.stdout.readline()
process_stdout_line(line)
if line:
process_stdout_line(line)
if process_stderr_line is not None:
if not process.stderr:
raise RuntimeError(f"Cannot get process stderr of command {cmd!r}")
line = process.stderr.readline()
if line:
line = process.stderr.readline()
process_stderr_line(line)
return process.returncode

Expand Down

0 comments on commit 0911232

Please sign in to comment.