add an error message for creating a project without python2 or python3 compiled. Closes #311

This commit is contained in:
Mathieu Virbel 2018-11-16 10:52:02 +01:00
parent cfc9dc1c29
commit 7b5e28d643

View file

@ -1334,6 +1334,13 @@ Xcode:
from cookiecutter.main import cookiecutter
ctx = Context()
ensure_recipes_loaded(ctx)
if not hasattr(ctx, "python_ver"):
print("ERROR: No python recipes compiled!")
print("ERROR: You must have compiled at least python2 or")
print("ERROR: python3 recipes to be able to create a project.")
sys.exit(1)
template_dir = join(curdir, "tools", "templates")
context = {
"title": args.name,