Skip to content

Commit d057295

Browse files
committed
run_before_script: Remove reliance on console_to_str()
1 parent e8971fc commit d057295

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/tmuxp/util.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
import sys
1010
import typing as t
1111

12-
from libtmux._compat import console_to_str
13-
1412
from . import exc
1513

1614
if t.TYPE_CHECKING:
@@ -37,16 +35,17 @@ def run_before_script(
3735
stderr=subprocess.PIPE,
3836
stdout=subprocess.PIPE,
3937
cwd=cwd,
38+
text=True,
4039
)
4140
if proc.stdout is not None:
4241
for line in iter(proc.stdout.readline, b""):
43-
sys.stdout.write(console_to_str(line))
42+
sys.stdout.write(line)
4443
proc.wait()
4544

4645
if proc.returncode and proc.stderr is not None:
4746
stderr = proc.stderr.read()
4847
proc.stderr.close()
49-
stderr_strlist = console_to_str(stderr).split("\n")
48+
stderr_strlist = stderr.split("\n")
5049
stderr_str = "\n".join(list(filter(None, stderr_strlist))) # filter empty
5150

5251
raise exc.BeforeLoadScriptError(

0 commit comments

Comments
 (0)