scripts: Cleanly exit manage.py when run with python2.

Fixes #10854.
This commit is contained in:
Rohitt Vashishtha 2018-11-29 21:22:01 +00:00 committed by Tim Abbott
parent 30e5b5fe55
commit 82ea61a3cc
1 changed files with 5 additions and 0 deletions

View File

@ -1,7 +1,12 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
from __future__ import (print_function)
import os import os
import sys import sys
import types import types
if sys.version_info <= (3, 0):
print("Error: Zulip is a Python 3 project, and cannot be run with Python 2.")
print("Use e.g. `/path/to/manage.py` not `python /path/to/manage.py`.")
sys.exit(1)
BASE_DIR = os.path.dirname(os.path.abspath(__file__)) BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR) sys.path.append(BASE_DIR)