Browse Source

deploy-ng: add nag screen warning users who are still on Python 2

See #602
rdb 6 years ago
parent
commit
b08e38cf3d
1 changed files with 10 additions and 0 deletions
  1. 10 0
      direct/src/dist/commands.py

+ 10 - 0
direct/src/dist/commands.py

@@ -13,6 +13,7 @@ import stat
 import struct
 import imp
 import string
+import time
 
 import setuptools
 import distutils.log
@@ -30,6 +31,15 @@ if sys.version_info < (3, 0):
     # Python 3 defines these subtypes of IOError, but Python 2 doesn't.
     FileNotFoundError = IOError
 
+    # Warn the user.  They might be using Python 2 by accident.
+    print("=================================================================")
+    print("WARNING: You are using Python 2, which will soon be discontinued.")
+    print("WARNING: Please use Python 3 for best results and continued")
+    print("WARNING: support after the EOL date of December 31st, 2019.")
+    print("=================================================================")
+    sys.stdout.flush()
+    time.sleep(4.0)
+
 
 def _parse_list(input):
     if isinstance(input, basestring):