diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2009-01-19 12:46:54 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2009-01-19 12:46:54 +0000 |
| commit | 9c6efb2eeaca11c7e65ce3b63a09f2d1e0b247c3 (patch) | |
| tree | 12e31c9fd7d20748a36ebca6b3b51dece5a8917b | |
| parent | dd2e1356f014a9869ea3baef1f7efb9f94bf696c (diff) | |
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
| -rw-r--r-- | AUTHORS | 1 | ||||
| -rw-r--r-- | django/core/management/__init__.py | 7 |
2 files changed, 8 insertions, 0 deletions
@@ -423,6 +423,7 @@ answer newbie questions, and generally made Django that much better: Chris Wesseling <Chris.Wesseling@cwi.nl> James Wheare <django@sparemint.com> Mike Wiacek <mjwiacek@google.com> + Frank Wierzbicki charly.wilhelm@gmail.com Rachel Willmer <http://www.willmer.com/kb/> Gary Wilson <gary.wilson@gmail.com> diff --git a/django/core/management/__init__.py b/django/core/management/__init__.py index ce618cafb4..c4396d2976 100644 --- a/django/core/management/__init__.py +++ b/django/core/management/__init__.py @@ -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() |
