From 82ea61a3cc45ee310119463fba5196bd5287b3c2 Mon Sep 17 00:00:00 2001 From: Rohitt Vashishtha Date: Thu, 29 Nov 2018 21:22:01 +0000 Subject: [PATCH] scripts: Cleanly exit manage.py when run with python2. Fixes #10854. --- manage.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/manage.py b/manage.py index 1a2af68cd2..17f6688d32 100755 --- a/manage.py +++ b/manage.py @@ -1,7 +1,12 @@ #!/usr/bin/env python3 +from __future__ import (print_function) import os import sys 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__)) sys.path.append(BASE_DIR)