use bytes for find

pull/239/head
Spencer Young 5 years ago
parent 92f2df948c
commit 3fbef3e02b

@ -105,8 +105,8 @@ def comments_between_tokens(token1, token2):
pointer = token1.end_mark.pointer pointer = token1.end_mark.pointer
comment_before = None comment_before = None
for line in buf.split('\n'): for line in buf.split(b'\n'):
pos = line.find('#') pos = line.find(b'#')
if pos != -1: if pos != -1:
comment = Comment(line_no, column_no + pos, comment = Comment(line_no, column_no + pos,
token1.end_mark.buffer, pointer + pos, token1.end_mark.buffer, pointer + pos,

Loading…
Cancel
Save