# # # patch "mtn.py" # from [ce82ebdbae23625213b452bda42dc803555e69a8] # to [fed92195c9a8d1bcb0d4e0a94ad635abf9aea7bf] # ============================================================ --- mtn.py ce82ebdbae23625213b452bda42dc803555e69a8 +++ mtn.py fed92195c9a8d1bcb0d4e0a94ad635abf9aea7bf @@ -143,11 +143,11 @@ class Automate(Runner): code_max = code data_buf += data while True: - idx = data_buf.find('\n') - if idx == -1: + nl_idx = data_buf.find('\n') + if nl_idx == -1: break - yield data_buf[:idx] - data_buf = data_buf[idx+1:] + yield data_buf[:nl_idx] + data_buf = data_buf[nl_idx+1:] # left over data? if data_buf: yield data_buf @@ -245,6 +245,7 @@ def basic_io_from_stream(gen): line = line[1:] state.has_started = True + idx = 0 for idx, c in enumerate(line): if state.in_escape: if c != '\\' and c != '"':