mirror of
https://github.com/django/django.git
synced 2025-10-27 23:56:08 +00:00
Fixed #25246 -- Guarded against duplicate paths in AppConfig.
This commit is contained in:
@@ -62,6 +62,10 @@ class AppConfig(object):
|
||||
filename = getattr(module, '__file__', None)
|
||||
if filename is not None:
|
||||
paths = [os.path.dirname(filename)]
|
||||
else:
|
||||
# For unknown reasons, sometimes the list returned by __path__
|
||||
# contains duplicates that must be removed (#25246).
|
||||
paths = list(set(paths))
|
||||
if len(paths) > 1:
|
||||
raise ImproperlyConfigured(
|
||||
"The app module %r has multiple filesystem locations (%r); "
|
||||
|
||||
Reference in New Issue
Block a user