Update of /cvsroot/tmda/tmda/contrib/cgi
In directory sc8-pr-cvs1:/tmp/cvs-serv6634
Modified Files:
compile
Log Message:
Kill compilation with a friendly error message if user tries to compile with
a Python version before 2.1.
Index: compile
===================================================================
RCS file: /cvsroot/tmda/tmda/contrib/cgi/compile,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- compile 19 Feb 2003 21:26:15 -0000 1.7
+++ compile 17 Mar 2003 22:18:00 -0000 1.8
@@ -84,6 +84,7 @@
import getopt
import os.path
+import re
import string
import sys
@@ -131,6 +132,27 @@
elif Opt in ("-n", "--no-su"):
Perm = 0755
Mode = "no-su"
+
+# Check that we're running in Python version 2.1 or higher
+temp = re.search("^(\d+)\.(\d+)\s", sys.version)
+major = int(temp.group(1))
+minor = int(temp.group(2))
+if (major < 2) or ((major == 2) and (minor < 1)):
+ print """Compile terminated. tmda-cgi requires Python version 2.1 or higher.
+
+Either install the latest version of Python or specify the appropriate Python
+interpreter when you issue the compile command. Instead of typing:
+
+ $ ./compile <options>
+
+Type:
+
+ $ /usr/bin/python2 compile <options>
+
+(Assuming that your Python 2.1+ can be found at /usr/bin/python2.)
+The compiler will save the correct version of the Python interpreter and use it
+when tmda-cgi is run."""
+ sys.exit()
Path = os.path.abspath(Path)
_______________________________________
tmda-cvs mailing list
http://tmda.net/lists/listinfo/tmda-cvs