summaryrefslogtreecommitdiff
path: root/django/conf/project_template
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-01-21 20:02:00 -0500
committerGitHub <noreply@github.com>2017-01-21 20:02:00 -0500
commitd170c63351944fd91b2206d10f89e7ff75b53b76 (patch)
treee2be66471ab071fa0ce75097d66650b650c53853 /django/conf/project_template
parentc22212220a7900173358a1f16179dcfc9e03de78 (diff)
Refs #23919 -- Removed misc references to Python 2.
Diffstat (limited to 'django/conf/project_template')
-rwxr-xr-xdjango/conf/project_template/manage.py-tpl19
1 files changed, 6 insertions, 13 deletions
diff --git a/django/conf/project_template/manage.py-tpl b/django/conf/project_template/manage.py-tpl
index 41309844e0..9f83e65491 100755
--- a/django/conf/project_template/manage.py-tpl
+++ b/django/conf/project_template/manage.py-tpl
@@ -6,17 +6,10 @@ if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings")
try:
from django.core.management import execute_from_command_line
- except ImportError:
- # The above import may fail for some other reason. Ensure that the
- # issue is really that Django is missing to avoid masking other
- # exceptions on Python 2.
- try:
- import django
- except ImportError:
- raise ImportError(
- "Couldn't import Django. Are you sure it's installed and "
- "available on your PYTHONPATH environment variable? Did you "
- "forget to activate a virtual environment?"
- )
- raise
+ except ImportError as exc:
+ raise ImportError(
+ "Couldn't import Django. Are you sure it's installed and "
+ "available on your PYTHONPATH environment variable? Did you "
+ "forget to activate a virtual environment?"
+ ) from exc
execute_from_command_line(sys.argv)