Ticket #6950: threadsafe_template_loader-const-correct.diff

File threadsafe_template_loader-const-correct.diff, 1.0 KB (added by mrts, 10 years ago)

minor stylistic improvements (tuple instead of list for const-correctness)

  • django/template/loader.py

     
    4646    # circular import errors. See Django ticket #1292.
    4747    global template_source_loaders
    4848    if template_source_loaders is None:
    49         template_source_loaders = []
     49        loaders = []
    5050        for path in settings.TEMPLATE_LOADERS:
    5151            i = path.rfind('.')
    5252            module, attr = path[:i], path[i+1:]
     
    6262                import warnings
    6363                warnings.warn("Your TEMPLATE_LOADERS setting includes %r, but your Python installation doesn't support that type of template loading. Consider removing that line from TEMPLATE_LOADERS." % path)
    6464            else:
    65                 template_source_loaders.append(func)
     65                loaders.append(func)
     66        template_source_loaders = tuple(loaders)
    6667    for loader in template_source_loaders:
    6768        try:
    6869            source, display_name = loader(name, dirs)
Back to Top