File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 3
3
import selectors
4
4
import sys
5
5
import tempfile
6
- from asyncio import DefaultEventLoopPolicy , get_event_loop_policy , set_event_loop_policy
6
+ from asyncio import get_event_loop_policy , set_event_loop_policy
7
+ from asyncio .unix_events import _UnixDefaultEventLoopPolicy
7
8
from io import IOBase
8
9
9
10
import questionary
22
23
)
23
24
24
25
25
- class CZEventLoopPolicy (DefaultEventLoopPolicy ):
26
+ class CZEventLoopPolicy (_UnixDefaultEventLoopPolicy ):
26
27
def get_event_loop (self ):
27
28
self .set_event_loop (self ._loop_factory (selectors .SelectSelector ()))
28
29
return self ._local ._loop
@@ -36,7 +37,7 @@ def __init__(self, stdx: IOBase):
36
37
fd = os .open ("/dev/tty" , os .O_RDWR | os .O_NOCTTY )
37
38
tty = open (fd , "wb+" , buffering = 0 )
38
39
else :
39
- tty = open ("/dev/tty" , "w " )
40
+ tty = open ("/dev/tty" , "wb " )
40
41
else :
41
42
fd = os .open ("/dev/tty" , os .O_RDWR | os .O_NOCTTY )
42
43
if self ._fileno == 0 :
Original file line number Diff line number Diff line change @@ -230,7 +230,7 @@ def test_WrapStdx(mocker):
230
230
wrap_stout .write ("data" )
231
231
232
232
if sys .platform == "linux" :
233
- writer_mock .assert_called_once_with ("/dev/tty" , "w " )
233
+ writer_mock .assert_called_once_with ("/dev/tty" , "wb " )
234
234
else :
235
235
pass
236
236
writer_mock ().write .assert_called_once_with ("data" )
@@ -244,7 +244,7 @@ def test_WrapStdx(mocker):
244
244
wrap_sterr .write ("data" )
245
245
246
246
if sys .platform == "linux" :
247
- writer_mock .assert_called_once_with ("/dev/tty" , "w " )
247
+ writer_mock .assert_called_once_with ("/dev/tty" , "wb " )
248
248
else :
249
249
pass
250
250
writer_mock ().write .assert_called_once_with ("data" )
You can’t perform that action at this time.
0 commit comments