Skip to content

Commit 51d11a0

Browse files
committed
refactor(commands/commit) ignore type worrn
1 parent b4b178d commit 51d11a0

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

commitizen/commands/commit.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
import selectors
44
import sys
55
import tempfile
6-
from asyncio import get_event_loop_policy, set_event_loop_policy
7-
from asyncio.unix_events import _UnixDefaultEventLoopPolicy
6+
from asyncio import DefaultEventLoopPolicy, get_event_loop_policy, set_event_loop_policy
87
from io import IOBase
98

109
import questionary
@@ -23,7 +22,7 @@
2322
)
2423

2524

26-
class CZEventLoopPolicy(_UnixDefaultEventLoopPolicy):
25+
class CZEventLoopPolicy(DefaultEventLoopPolicy): # type: ignore
2726
def get_event_loop(self):
2827
self.set_event_loop(self._loop_factory(selectors.SelectSelector()))
2928
return self._local._loop
@@ -37,7 +36,7 @@ def __init__(self, stdx: IOBase):
3736
fd = os.open("/dev/tty", os.O_RDWR | os.O_NOCTTY)
3837
tty = open(fd, "wb+", buffering=0)
3938
else:
40-
tty = open("/dev/tty", "wb")
39+
tty = open("/dev/tty", "w") # type: ignore
4140
else:
4241
fd = os.open("/dev/tty", os.O_RDWR | os.O_NOCTTY)
4342
if self._fileno == 0:

tests/commands/test_commit_command.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def test_WrapStdx(mocker):
230230
wrap_stout.write("data")
231231

232232
if sys.platform == "linux":
233-
writer_mock.assert_called_once_with("/dev/tty", "wb")
233+
writer_mock.assert_called_once_with("/dev/tty", "w")
234234
else:
235235
pass
236236
writer_mock().write.assert_called_once_with("data")
@@ -244,7 +244,7 @@ def test_WrapStdx(mocker):
244244
wrap_sterr.write("data")
245245

246246
if sys.platform == "linux":
247-
writer_mock.assert_called_once_with("/dev/tty", "wb")
247+
writer_mock.assert_called_once_with("/dev/tty", "w")
248248
else:
249249
pass
250250
writer_mock().write.assert_called_once_with("data")

0 commit comments

Comments
 (0)