Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2d57068

Browse files
committed
Remove newlines from file contents
1 parent 69333fa commit 2d57068

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pre_commit/languages/pygrep.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def _process_filename_by_line(pattern, filename):
2929
def _process_filename_at_once(pattern, filename):
3030
retv = 0
3131
with open(filename, 'rb') as f:
32-
match = pattern.search(f.read())
32+
match = pattern.search(f.read().decode('utf-8').replace('\n',''))
3333
if match:
3434
retv = 1
3535
output.write('{}:'.format(filename))

0 commit comments

Comments
 (0)