summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-12-02 23:26:01 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-12-02 23:26:01 +0000
commita88ca126fcfe579a38f3e94a7668b626f0e468c3 (patch)
tree9e09dc34be6365da6d18550e994afe6849a5fb01
parent1f629bff993d1d1d75b335ebc669dd9d3a081cc1 (diff)
Fixed #5002 -- Fixed a small problem when running via pdb. Thanks, dummylink@gmail.com.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6853 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/core/management/__init__.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/django/core/management/__init__.py b/django/core/management/__init__.py
index 04591479b3..ee0eb6fda8 100644
--- a/django/core/management/__init__.py
+++ b/django/core/management/__init__.py
@@ -254,6 +254,8 @@ def setup_environ(settings_mod):
# way. For example, if this file (manage.py) lives in a directory
# "myproject", this code would add "/path/to/myproject" to sys.path.
project_directory, settings_filename = os.path.split(settings_mod.__file__)
+ if not project_directory:
+ project_directory = os.getcwd()
project_name = os.path.basename(project_directory)
settings_name = os.path.splitext(settings_filename)[0]
sys.path.append(os.path.join(project_directory, os.pardir))