Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[1.6.x] Removed relative usage of import_module

Python 3 version of importlib doesn't support this syntax.
Partial backport of fdd7a35. Refs #21335.
  • Loading branch information...
commit ec0a3f5085219cd647d3e93841018987ce5384bf 1 parent e052ada
@claudep claudep authored
View
2  django/contrib/gis/geometry/backend/__init__.py
@@ -5,7 +5,7 @@
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)
View
2  django/db/models/loading.py
@@ -96,7 +96,7 @@ def load_app(self, app_name, can_postpone=False):
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
View
2  django/db/utils.py
@@ -110,7 +110,7 @@ def inner(*args, **kwargs):
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.
View
2  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
Please sign in to comment.
Something went wrong with that request. Please try again.