@@ -77,7 +77,8 @@ def _test_transcript(self, fname: str, transcript):
7777 try :
7878 line = next (transcript )
7979 except StopIteration as exc :
80- msg = 'Transcript broke off while reading command beginning at line {} with\n {}' .format (line_num , command [0 ])
80+ msg = 'Transcript broke off while reading command beginning at line {} with\n {}' .format (line_num ,
81+ command [0 ])
8182 raise StopIteration (msg ) from exc
8283 line_num += 1
8384 command = '' .join (command )
@@ -138,7 +139,7 @@ def _transform_transcript_expected(self, s: str) -> str:
138139 # there is a slash, add everything we have found so far
139140 # add stuff before the first slash as plain text
140141 regex += re .escape (s [start :first_slash_pos ])
141- start = first_slash_pos + 1
142+ start = first_slash_pos + 1
142143 # and go find the next one
143144 (regex , second_slash_pos , start ) = self ._escaped_find (regex , s , start , True )
144145 if second_slash_pos > 0 :
@@ -151,7 +152,7 @@ def _transform_transcript_expected(self, s: str) -> str:
151152 else :
152153 # No closing slash, we have to add the first slash,
153154 # and the rest of the text
154- regex += re .escape (s [start - 1 :])
155+ regex += re .escape (s [start - 1 :])
155156 break
156157 return regex
157158
@@ -178,24 +179,24 @@ def _escaped_find(regex: str, s: str, start: int, in_regex: bool) -> Tuple[str,
178179 break
179180 else :
180181 # check if the slash is preceeded by a backslash
181- if s [pos - 1 :pos ] == '\\ ' :
182+ if s [pos - 1 :pos ] == '\\ ' :
182183 # it is.
183184 if in_regex :
184185 # add everything up to the backslash as a
185186 # regular expression
186- regex += s [start :pos - 1 ]
187+ regex += s [start :pos - 1 ]
187188 # skip the backslash, and add the slash
188189 regex += s [pos ]
189190 else :
190191 # add everything up to the backslash as escaped
191192 # plain text
192- regex += re .escape (s [start :pos - 1 ])
193+ regex += re .escape (s [start :pos - 1 ])
193194 # and then add the slash as escaped
194195 # plain text
195196 regex += re .escape (s [pos ])
196197 # update start to show we have handled everything
197198 # before it
198- start = pos + 1
199+ start = pos + 1
199200 # and continue to look
200201 else :
201202 # slash is not escaped, this is what we are looking for
0 commit comments