summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2013-10-26 23:22:21 +0200
committerClaude Paroz <claude@2xlibre.net>2013-10-26 23:22:21 +0200
commitec0a3f5085219cd647d3e93841018987ce5384bf (patch)
treef795b496b04cec9c5ef9df4c506d96ab5f158b61 /django
parente052ada0f6f21208d0f215d2f9184c4069ac1419 (diff)
[1.6.x] Removed relative usage of import_module
Python 3 version of importlib doesn't support this syntax. Partial backport of fdd7a355bf. Refs #21335.
Diffstat (limited to 'django')
-rw-r--r--django/contrib/gis/geometry/backend/__init__.py2
-rw-r--r--django/db/models/loading.py2
-rw-r--r--django/db/utils.py2
-rw-r--r--django/utils/formats.py2
4 files changed, 4 insertions, 4 deletions
diff --git a/django/contrib/gis/geometry/backend/__init__.py b/django/contrib/gis/geometry/backend/__init__.py
index d9f30bb256..52fa0dedd4 100644
--- a/django/contrib/gis/geometry/backend/__init__.py
+++ b/django/contrib/gis/geometry/backend/__init__.py
@@ -5,7 +5,7 @@ from django.utils.importlib import import_module
geom_backend = getattr(settings, 'GEOMETRY_BACKEND', 'geos')
try:
- module = import_module('.%s' % geom_backend, 'django.contrib.gis.geometry.backend')
+ module = import_module('django.contrib.gis.geometry.backend.%s' % geom_backend)
except ImportError:
try:
module = import_module(geom_backend)
diff --git a/django/db/models/loading.py b/django/db/models/loading.py
index 40aa983c25..bb87728a5c 100644
--- a/django/db/models/loading.py
+++ b/django/db/models/loading.py
@@ -96,7 +96,7 @@ class AppCache(object):
self.nesting_level += 1
app_module = import_module(app_name)
try:
- models = import_module('.models', app_name)
+ models = import_module('%s.models' % app_name)
except ImportError:
self.nesting_level -= 1
# If the app doesn't have a models module, we can just ignore the
diff --git a/django/db/utils.py b/django/db/utils.py
index 4afc592e64..eb5708ccf6 100644
--- a/django/db/utils.py
+++ b/django/db/utils.py
@@ -110,7 +110,7 @@ class DatabaseErrorWrapper(object):
def load_backend(backend_name):
# Look for a fully qualified database backend name
try:
- return import_module('.base', backend_name)
+ return import_module('%s.base' % backend_name)
except ImportError as e_user:
# The database backend wasn't found. Display a helpful error message
# listing all possible (built-in) database backends.
diff --git a/django/utils/formats.py b/django/utils/formats.py
index cc66149026..dbe1716639 100644
--- a/django/utils/formats.py
+++ b/django/utils/formats.py
@@ -54,7 +54,7 @@ def iter_format_modules(lang):
for location in format_locations:
for loc in locales:
try:
- yield import_module('.formats', location % loc)
+ yield import_module('%s.formats' % (location % loc))
except ImportError:
pass