changeset 5882:5955979b0d53

rst parser: fix include and macro directives directives must always return a list of nodes. if they don't want to return anything, they need to return an empty list.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 16 Sep 2012 21:42:37 +0200
parents 38eb29d48665
children cabef5f26ec5
files MoinMoin/parser/text_rst.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/parser/text_rst.py	Sun Sep 16 21:03:13 2012 +0200
+++ b/MoinMoin/parser/text_rst.py	Sun Sep 16 21:42:37 2012 +0200
@@ -580,7 +580,7 @@
         else:
             lines = [_("**Maximum number of allowed includes exceeded**")]
             state_machine.insert_input(lines, 'MoinDirectives')
-            return
+            return []
 
         if len(content):
             pagename = content[0]
@@ -598,7 +598,7 @@
                     lines = [_("**Could not find the referenced page: %s**") % (pagename, )]
             # Insert the text from the included document and then continue parsing
             state_machine.insert_input(lines, 'MoinDirectives')
-        return
+        return []
 
     include.has_content = include.content = True
     include.option_spec = {}
@@ -623,7 +623,7 @@
             ref = reference(macro, refuri=macro)
             ref['name'] = macro
             return [ref]
-        return
+        return []
 
     macro.has_content = macro.content = True
     macro.option_spec = {}