summaryrefslogtreecommitdiff
path: root/django/core/management/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/core/management/__init__.py')
-rw-r--r--django/core/management/__init__.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/django/core/management/__init__.py b/django/core/management/__init__.py
index bb26c20666..fab5059376 100644
--- a/django/core/management/__init__.py
+++ b/django/core/management/__init__.py
@@ -9,6 +9,7 @@ from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import BaseCommand, CommandError, handle_default_options
from django.core.management.color import color_style
from django.utils.importlib import import_module
+from django.utils._os import upath
from django.utils import six
# For backwards compatibility: get_version() used to be in this module.
@@ -410,10 +411,10 @@ def setup_environ(settings_mod, original_settings_path=None):
# Add this project to sys.path so that it's importable in the conventional
# way. For example, if this file (manage.py) lives in a directory
# "myproject", this code would add "/path/to/myproject" to sys.path.
- if '__init__.py' in settings_mod.__file__:
- p = os.path.dirname(settings_mod.__file__)
+ if '__init__.py' in upath(settings_mod.__file__):
+ p = os.path.dirname(upath(settings_mod.__file__))
else:
- p = settings_mod.__file__
+ p = upath(settings_mod.__file__)
project_directory, settings_filename = os.path.split(p)
if project_directory == os.curdir or not project_directory:
project_directory = os.getcwd()