Skip to content
Permalink
Browse files
Working around a Python trap.
  • Loading branch information
felixfontein committed Oct 9, 2016
1 parent 75054f3 commit f36c6403ef8c5f9601da5a428fffcd81c6ee9944
Showing with 3 additions and 2 deletions.
  1. +3 −2 nikola/nikola.py
@@ -1986,7 +1986,7 @@ def scan_posts(self, really=False, ignore_quit=False, quiet=False):
sys.exit(1)
signal('scanned').send(self)

def generic_renderer(self, lang, output_name, template_name, filters, file_deps=[], uptodate_deps=[], pre_context=None, post_context=None, context_deps_remove=None, post_deps_dict=None, url_type=None):
def generic_renderer(self, lang, output_name, template_name, filters, file_deps=None, uptodate_deps=None, pre_context=None, post_context=None, context_deps_remove=None, post_deps_dict=None, url_type=None):
"""Helper function for rendering pages and post lists and other related pages.
lang is the current language.
@@ -2003,6 +2003,7 @@ def generic_renderer(self, lang, output_name, template_name, filters, file_deps=
"""
utils.LocaleBorg().set_locale(lang)

file_deps = [] if file_deps is None else file_deps
file_deps += self.template_system.template_deps(template_name)
file_deps = sorted(list(filter(None, file_deps)))

@@ -2036,7 +2037,7 @@ def generic_renderer(self, lang, output_name, template_name, filters, file_deps=
'actions': [(self.render_template, [template_name, output_name,
context, url_type])],
'clean': True,
'uptodate': [config_changed(deps_dict, 'nikola.nikola.Nikola.generic_renderer')] + uptodate_deps
'uptodate': [config_changed(deps_dict, 'nikola.nikola.Nikola.generic_renderer')] + ([] if uptodate_deps is None else uptodate_deps)
}

return utils.apply_filters(task, filters)

0 comments on commit f36c640

Please sign in to comment.