Skip to content

Commit 5fcd56c

Browse files
committed
test: limit search for \r to first 100 bytes.
Don't scan entire file. just look at 100 bytes which should include all of the first line.
1 parent 5901a16 commit 5fcd56c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

test/test_admin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def find_in_file(filename, regexp):
6464

6565
try:
6666
# handle text files with \r\n line endings
67-
contents.index("\r")
67+
contents.index("\r", 0, 100)
6868
contents = contents.replace("\r\n", "\n")
6969
except ValueError:
7070
pass

test/test_demo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def run_install_demo(self, template, db="anydbm"):
5454

5555
try:
5656
# handle text files with \r\n line endings
57-
config_lines.index("\r")
57+
config_lines.index("\r", 0, 100)
5858
config_lines = config_lines.replace("\r\n", "\n")
5959
except ValueError:
6060
pass
@@ -99,7 +99,7 @@ def testDemoJinja(self):
9999

100100
try:
101101
# handle text files with \r\n line endings
102-
config_lines.index("\r")
102+
config_lines.index("\r", 0, 100)
103103
config_lines = config_lines.replace("\r\n", "\n")
104104
except ValueError:
105105
pass

0 commit comments

Comments
 (0)