summaryrefslogtreecommitdiff
path: root/django/db/models/loading.py
diff options
context:
space:
mode:
authorKaren Tracey <kmtracey@gmail.com>2010-04-12 12:39:18 +0000
committerKaren Tracey <kmtracey@gmail.com>2010-04-12 12:39:18 +0000
commit55c31fbdefe3bc3c948599b66781e7a9a1dae2a2 (patch)
treefa67da6e07f2a4533a766c5a2c60d7e976e6404a /django/db/models/loading.py
parent82b8b67446f6737a22593876c8e77ff19532e2c5 (diff)
Fixed #11696: Changed app loading code so that it does not swallow import errors that used to be (prior to r10088) raised.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12950 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/models/loading.py')
-rw-r--r--django/db/models/loading.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/django/db/models/loading.py b/django/db/models/loading.py
index 3151b8a93f..06ddd7a4e4 100644
--- a/django/db/models/loading.py
+++ b/django/db/models/loading.py
@@ -5,6 +5,7 @@ from django.core.exceptions import ImproperlyConfigured
from django.utils.datastructures import SortedDict
from django.utils.importlib import import_module
+import imp
import sys
import os
import threading
@@ -71,8 +72,9 @@ class AppCache(object):
"""
self.handled[app_name] = None
self.nesting_level += 1
+ app_module = import_module(app_name)
try:
- models = import_module('.models', app_name)
+ imp.find_module('models', app_module.__path__)
except ImportError:
self.nesting_level -= 1
if can_postpone:
@@ -82,6 +84,7 @@ class AppCache(object):
# populate).
self.postponed.append(app_name)
return None
+ models = import_module('.models', app_name)
self.nesting_level -= 1
if models not in self.app_store:
self.app_store[models] = len(self.app_store)