Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[1.0.X] Fixed #9789 -- Handle jython's compiled settings filename cor…

…rectly.

Patch from Frank Wierzbicki.

Backport of r9775 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9776 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 3e19109ab61f851683d9a6427a52b4866071fa60 1 parent 5ce4031
@malcolmt malcolmt authored
Showing with 8 additions and 0 deletions.
  1. +1 −0  AUTHORS
  2. +7 −0 django/core/management/__init__.py
View
1  AUTHORS
@@ -418,6 +418,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>
View
7 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()

0 comments on commit 3e19109

Please sign in to comment.
Something went wrong with that request. Please try again.