summaryrefslogtreecommitdiff
path: root/pygments/lexers/installers.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-10-08 00:20:06 +0200
committerGeorg Brandl <georg@python.org>2014-10-08 00:20:06 +0200
commit506f11db8b046c97b3730ae40ae4180d5f4112f2 (patch)
treee9e89e4e9809287365595e0be557b05d1161ef49 /pygments/lexers/installers.py
parent1fd65ff28bc90c6ea89a4f4e6397818ab1a99b4c (diff)
downloadpygments-506f11db8b046c97b3730ae40ae4180d5f4112f2.tar.gz
Closes #892: fix overzealous analyse_text of the SourcesListLexer.
Also remove any "default" return from analyse_text methods.
Diffstat (limited to 'pygments/lexers/installers.py')
-rw-r--r--pygments/lexers/installers.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/pygments/lexers/installers.py b/pygments/lexers/installers.py
index b76db0a9..54369da1 100644
--- a/pygments/lexers/installers.py
+++ b/pygments/lexers/installers.py
@@ -258,12 +258,10 @@ class SourcesListLexer(RegexLexer):
}
def analyse_text(text):
- for line in text.split('\n'):
+ for line in text.splitlines():
line = line.strip()
- if not (line.startswith('#') or line.startswith('deb ') or
- line.startswith('deb-src ') or not line):
- return False
- return True
+ if line.startswith('deb ') or line.startswith('deb-src '):
+ return True
class DebianControlLexer(RegexLexer):