#3446: use a standard utililty function for importing a module from a string
---------------------------------------------------+------------------------
Reporter: Gary Wilson <[EMAIL PROTECTED]> | Owner:
gregorth
Status: closed | Component:
Core framework
Version: SVN | Resolution:
wontfix
Keywords: | Stage:
Accepted
Has_patch: 0 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
---------------------------------------------------+------------------------
Comment (by gwilson):
I was thinking something a little bigger than replacing just the one
`__import__` line, like several places where there is code like:
{{{
#!python
i = path.rfind('.')
module, attr = path[:i], path[i+1:]
try:
mod = __import__(module, globals(), locals(), [attr])
except ImportError, e:
raise ImproperlyConfigured, 'Error importing template source loader
%s: "%s"' % (module, e)
try:
func = getattr(mod, attr)
except AttributeError:
raise ImproperlyConfigured, 'Module "%s" does not define a "%s"
callable template source loader' % (module, attr)
}}}
but you are probably right in that these can differ slightly and it might
not be worth the trouble.
--
Ticket URL: <http://code.djangoproject.com/ticket/3446#comment:5>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---