Skip to content

Commit 3060998

Browse files
author
Pietro Albini
committed
Error message when someone uses invoke with python2
1 parent 7450003 commit 3060998

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tasks.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,23 @@
66
Released under the MIT license
77
"""
88

9+
# Version check, ensure it's run with Python 3
10+
import sys
911
import os
12+
if sys.version_info[0] < 3:
13+
print("Hey! It seems you installed invoke for Python 2!")
14+
print("Please make sure you installed it with Python 3, else this script "
15+
"won't work.")
16+
print("")
17+
print("In order to fix the issue, please execute the following commands:")
18+
if os.name == "nt":
19+
print(" py -m pip uninstall invoke")
20+
print(" py -3 -m pip install invoke")
21+
else:
22+
print(" python -m pip uninstall invoke")
23+
print(" python3 -m pip install invoke")
24+
exit(1)
25+
1026
import shutil
1127
import glob
1228
import re

0 commit comments

Comments
 (0)