Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[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
Malcolm Tredinnick authored January 19, 2009
1  AUTHORS
@@ -418,6 +418,7 @@ answer newbie questions, and generally made Django that much better:
418 418
     Chris Wesseling <Chris.Wesseling@cwi.nl>
419 419
     James Wheare <django@sparemint.com>
420 420
     Mike Wiacek <mjwiacek@google.com>
  421
+    Frank Wierzbicki
421 422
     charly.wilhelm@gmail.com
422 423
     Rachel Willmer <http://www.willmer.com/kb/>
423 424
     Gary Wilson <gary.wilson@gmail.com>
7  django/core/management/__init__.py
@@ -311,7 +311,14 @@ def setup_environ(settings_mod, original_settings_path=None):
311 311
     if project_directory == os.curdir or not project_directory:
312 312
         project_directory = os.getcwd()
313 313
     project_name = os.path.basename(project_directory)
  314
+
  315
+    # Strip filename suffix to get the module name.
314 316
     settings_name = os.path.splitext(settings_filename)[0]
  317
+
  318
+    # Strip $py for Jython compiled files (like settings$py.class)
  319
+    if settings_name.endswith("$py"):
  320
+        settings_name = settings_name[:-3]
  321
+
315 322
     sys.path.append(os.path.join(project_directory, os.pardir))
316 323
     project_module = __import__(project_name, {}, {}, [''])
317 324
     sys.path.pop()

0 notes on commit 3e19109

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