diff options
| author | Tim Graham <timograham@gmail.com> | 2017-01-21 20:02:00 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-01-21 20:02:00 -0500 |
| commit | d170c63351944fd91b2206d10f89e7ff75b53b76 (patch) | |
| tree | e2be66471ab071fa0ce75097d66650b650c53853 /django/conf/project_template | |
| parent | c22212220a7900173358a1f16179dcfc9e03de78 (diff) | |
Refs #23919 -- Removed misc references to Python 2.
Diffstat (limited to 'django/conf/project_template')
| -rwxr-xr-x | django/conf/project_template/manage.py-tpl | 19 |
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) |
