Skip to content

Commit

Permalink
better find substring
Browse files Browse the repository at this point in the history
  • Loading branch information
olivierverdier committed Oct 15, 2015
1 parent 6b4fd6b commit 3c84818
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pydflatex/latexlogparser.py
Expand Up @@ -77,7 +77,7 @@ def errors (self):
# sometimes issues warnings (like undefined references) in the
# form of errors...

if string.find(line, "pdfTeX warning") == -1:
if "pdfTeX warning" in line:
return True
return False

Expand Down Expand Up @@ -159,7 +159,7 @@ def parse (self, errors=False, boxes=False, refs=False, warnings=False):
if m:
parsing = False
skipping = True
pdfTeX = string.find(line, "pdfTeX warning") != -1
pdfTeX = "pdfTeX warning" in line
if (pdfTeX and warnings) or (errors and not pdfTeX):
if pdfTeX:
d = {
Expand Down Expand Up @@ -287,7 +287,7 @@ def parse (self, errors=False, boxes=False, refs=False, warnings=False):

# Other warnings

if line.find("Warning") != -1:
if "Warning" in line:
m = re_warning.match(line)
if m:
info = m.groupdict()
Expand Down
4 changes: 2 additions & 2 deletions test/test_output.py
Expand Up @@ -59,7 +59,7 @@ def assert_contains(self, match, line=None, regexp=False):
else:
out = all_out.splitlines()[line]
if not regexp:
does_match = out.find(match) != -1
does_match = match in out
else:
does_match = re.search(match, self.output, re.MULTILINE)
if not does_match:
Expand Down Expand Up @@ -117,7 +117,7 @@ def test_cite(self):

def test_nobox(self):
self.process_log('box')
self.assertEqual(self.output.find('Overfull'), -1)
self.assertNotIn('Overfull', self.output)

def test_unicode_missing(self):
self.t.xetex = True
Expand Down

0 comments on commit 3c84818

Please sign in to comment.