@@ -28,10 +28,11 @@ def get_event_loop(self):
28
28
self .set_event_loop (self ._loop_factory (selectors .SelectSelector ()))
29
29
return self ._local ._loop
30
30
31
+
31
32
class WrapStdx :
32
- def __init__ (self , stdx :IOBase ):
33
+ def __init__ (self , stdx : IOBase ):
33
34
self ._fileno = stdx .fileno ()
34
- if sys .platform == ' linux' :
35
+ if sys .platform == " linux" :
35
36
if self ._fileno == 0 :
36
37
fd = os .open ("/dev/tty" , os .O_RDWR | os .O_NOCTTY )
37
38
tty = open (fd , "wb+" , buffering = 0 )
@@ -46,7 +47,7 @@ def __init__(self, stdx:IOBase):
46
47
self .tty = tty
47
48
48
49
def __getattr__ (self , key ):
49
- if key == "encoding" and (sys .platform != ' linux' or self ._fileno == 0 ) :
50
+ if key == "encoding" and (sys .platform != " linux" or self ._fileno == 0 ):
50
51
return "UTF-8"
51
52
return getattr (self .tty , key )
52
53
@@ -104,7 +105,7 @@ def __call__(self):
104
105
old_stdin = sys .stdin
105
106
old_stdout = sys .stdout
106
107
old_stderr = sys .stderr
107
- old_event_loop_policy = get_event_loop_policy ()
108
+ old_event_loop_policy = get_event_loop_policy ()
108
109
set_event_loop_policy (CZEventLoopPolicy ())
109
110
sys .stdin = WrapStdx (sys .stdin )
110
111
sys .stdout = WrapStdx (sys .stdout )
@@ -135,12 +136,12 @@ def __call__(self):
135
136
raise DryRunExit ()
136
137
137
138
if commit_msg_file :
138
- defaultmesaage = ""
139
+ default_mesaage = ""
139
140
with open (commit_msg_file ) as f :
140
- defaultmesaage = f .read ()
141
+ default_message = f .read ()
141
142
with open (commit_msg_file , "w" ) as f :
142
143
f .write (m )
143
- f .write (defaultmesaage )
144
+ f .write (default_message )
144
145
out .success ("Commit message is successful!" )
145
146
return
146
147
@@ -151,7 +152,6 @@ def __call__(self):
151
152
else :
152
153
c = git .commit (m )
153
154
154
-
155
155
if c .return_code != 0 :
156
156
out .error (c .err )
157
157
0 commit comments