From 3fbef3e02b8b1b6f3be4db38a3e965b87c49e0f4 Mon Sep 17 00:00:00 2001 From: Spencer Young Date: Tue, 24 Mar 2020 20:27:29 -0700 Subject: [PATCH] use bytes for find --- yamllint/parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yamllint/parser.py b/yamllint/parser.py index 672f5a6..378a0cd 100644 --- a/yamllint/parser.py +++ b/yamllint/parser.py @@ -105,8 +105,8 @@ def comments_between_tokens(token1, token2): pointer = token1.end_mark.pointer comment_before = None - for line in buf.split('\n'): - pos = line.find('#') + for line in buf.split(b'\n'): + pos = line.find(b'#') if pos != -1: comment = Comment(line_no, column_no + pos, token1.end_mark.buffer, pointer + pos,