mirror of
https://github.com/django/django.git
synced 2025-10-29 02:52:24 +00:00
Fixed #8193: all dynamic imports in Django are now done correctly. I know this because Brett Cannon borrowed the time machine and brought Python 2.7's 'importlib back for inclusion in Django. Thanks for the patch-from-the-future, Brett!
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10088 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
ee2f04d79e
commit
c485e236bd
32 changed files with 128 additions and 71 deletions
|
|
@ -1,7 +1,8 @@
|
|||
from django import http
|
||||
from django.conf import settings
|
||||
from django.utils import importlib
|
||||
from django.utils.translation import check_for_language, activate, to_locale, get_language
|
||||
from django.utils.text import javascript_quote
|
||||
from django.conf import settings
|
||||
import os
|
||||
import gettext as gettext_module
|
||||
|
||||
|
|
@ -128,7 +129,7 @@ def javascript_catalog(request, domain='djangojs', packages=None):
|
|||
paths = []
|
||||
# first load all english languages files for defaults
|
||||
for package in packages:
|
||||
p = __import__(package, {}, {}, [''])
|
||||
p = importlib.import_module(package)
|
||||
path = os.path.join(os.path.dirname(p.__file__), 'locale')
|
||||
paths.append(path)
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue