Ticket #9220: diff.txt

File diff.txt, 1000 bytes (added by Sam Thompson, 16 years ago)

patch

Line 
1Index: django/utils/translation/trans_real.py
2===================================================================
3--- django/utils/translation/trans_real.py (revision 9084)
4+++ django/utils/translation/trans_real.py (working copy)
5@@ -177,10 +177,13 @@
6
7 for appname in settings.INSTALLED_APPS:
8 p = appname.rfind('.')
9- if p >= 0:
10- app = getattr(__import__(appname[:p], {}, {}, [appname[p+1:]]), appname[p+1:])
11- else:
12- app = __import__(appname, {}, {}, [])
13+ try:
14+ if p >= 0:
15+ app = getattr(__import__(appname[:p], {}, {}, [appname[p+1:]]), appname[p+1:])
16+ else:
17+ app = __import__(appname, {}, {}, [])
18+ except AttributeError, e:
19+ raise AttributeError(str(e) + ", Maybe %s doesn't exist or isn't a proper python module?" % appname)
20
21 apppath = os.path.join(os.path.dirname(app.__file__), 'locale')
22
Back to Top