mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #9789 -- Handle jython's compiled settings filename correctly.
Patch from Frank Wierzbicki. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9775 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -311,7 +311,14 @@ def setup_environ(settings_mod, original_settings_path=None):
|
||||
if project_directory == os.curdir or not project_directory:
|
||||
project_directory = os.getcwd()
|
||||
project_name = os.path.basename(project_directory)
|
||||
|
||||
# Strip filename suffix to get the module name.
|
||||
settings_name = os.path.splitext(settings_filename)[0]
|
||||
|
||||
# Strip $py for Jython compiled files (like settings$py.class)
|
||||
if settings_name.endswith("$py"):
|
||||
settings_name = settings_name[:-3]
|
||||
|
||||
sys.path.append(os.path.join(project_directory, os.pardir))
|
||||
project_module = __import__(project_name, {}, {}, [''])
|
||||
sys.path.pop()
|
||||
|
||||
Reference in New Issue
Block a user