changeset 3901:5b6ba9b8158d

wiki parser: avoid IndexError for empty shebang line
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 25 Jul 2008 22:22:51 +0200
parents 6816ffbeef49
children 4431145e4994
files MoinMoin/parser/text_moin_wiki.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/parser/text_moin_wiki.py	Sun Jul 20 19:07:52 2008 +0200
+++ b/MoinMoin/parser/text_moin_wiki.py	Fri Jul 25 22:22:51 2008 +0200
@@ -1244,8 +1244,11 @@
         #logging.debug("parser_content: %r" % line)
         if self.in_pre == 'search_parser' and line.strip():
             # try to find a parser specification
+            parser_name = ''
             if line.strip().startswith("#!"):
-                parser_name = line.strip()[2:].split()[0]
+                parser_name = line.strip()[2:]
+            if parser_name:
+                parser_name = parser_name.split()[0]
             else:
                 parser_name = 'text'
             self.setParser(parser_name)