Skip to content
Permalink
Browse files
Avoid mutable default value in generic_*_renderer
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Apr 28, 2018
1 parent 525de99 commit c55f840af12e2d86ffe2e1bfd89bad057f1a63ca
Showing 1 changed file with 8 additions and 2 deletions.
@@ -2430,7 +2430,7 @@ def atom_post_text(post, text):
data = data.decode('utf-8')
atom_file.write(data)

def generic_index_renderer(self, lang, posts, indexes_title, template_name, context_source, kw, basename, page_link, page_path, additional_dependencies=[]):
def generic_index_renderer(self, lang, posts, indexes_title, template_name, context_source, kw, basename, page_link, page_path, additional_dependencies=None):
"""Create an index page.
lang: The language
@@ -2467,6 +2467,9 @@ def generic_index_renderer(self, lang, posts, indexes_title, template_name, cont
kw['indexes_pretty_page_url'] = self.config["INDEXES_PRETTY_PAGE_URL"]
kw['show_index_page_navigation'] = self.config['SHOW_INDEX_PAGE_NAVIGATION']

if additional_dependencies is None:
additional_dependencies = []

# Split in smaller lists
lists = []
if kw["indexes_static"]:
@@ -2579,7 +2582,7 @@ def generic_index_renderer(self, lang, posts, indexes_title, template_name, cont
'uptodate': [utils.config_changed(kw, 'nikola.nikola.Nikola.generic_index_renderer')],
}, kw["filters"])

def generic_atom_renderer(self, lang, posts, context_source, kw, basename, classification, kind, additional_dependencies=[]):
def generic_atom_renderer(self, lang, posts, context_source, kw, basename, classification, kind, additional_dependencies=None):
"""Create an Atom feed.
lang: The language
@@ -2602,6 +2605,9 @@ def generic_atom_renderer(self, lang, posts, context_source, kw, basename, class
kw['feed_plain'] = self.config['FEED_PLAIN']
kw['feed_previewimage'] = self.config['FEED_PREVIEWIMAGE']

if additional_dependencies is None:
additional_dependencies = []

post_list = posts[:kw["feed_length"]]
feedlink = self.link(kind + "_atom", classification, lang)
feedpath = self.path(kind + "_atom", classification, lang)

0 comments on commit c55f840

Please sign in to comment.