Ticket #16585: importer_patch.diff

File importer_patch.diff, 925 bytes (added by Alexandr, 13 years ago)

Ticket patch variant

  • django/utils/dictconfig.py

    diff --git a/django/utils/dictconfig.py b/django/utils/dictconfig.py
    index 42fbd93..ab0bfed 100644
    a b class BaseConfigurator(object):  
    147147        'cfg' : 'cfg_convert',
    148148    }
    149149
    150     # We might want to use a different one, e.g. importlib
    151     importer = __import__
    152 
    153150    def __init__(self, config):
    154151        self.config = ConvertingDict(config)
    155152        self.config.configurator = self
    156153
     154    def importer(self, name, *args, **kwargs):
     155        """
     156        Imports the module name, potentially using the given globals and
     157        locals to determine how to interpret the name in a package context.
     158        """
     159        # We might want to use a different one, e.g. importlib
     160        return  __import__(name, *args, **kwargs)
     161
    157162    def resolve(self, s):
    158163        """
    159164        Resolve strings to objects using standard import and attribute
Back to Top