Browse code

2007-07-20 Michal Ludvig <michal@logix.cz>

* setup.py: Check correct Python version and ElementTree availability.




git-svn-id: https://s3tools.svn.sourceforge.net/svnroot/s3tools/s3cmd/trunk@131 830e0280-6d2a-0410-9c65-932aecc39d9d

Michal Ludvig authored on 2007/07/20 19:18:29
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+2007-07-20  Michal Ludvig  <michal@logix.cz>
2
+
3
+	* setup.py: Check correct Python version and ElementTree availability.
4
+
1 5
 2007-07-05  Michal Ludvig  <michal@logix.cz>
2 6
 
3 7
 	* s3cmd: --configure support for Proxy
... ...
@@ -4,6 +4,19 @@ import os
4 4
 
5 5
 import S3.PkgInfo
6 6
 
7
+if float("%d.%d" % sys.version_info[:2]) < 2.4:
8
+	sys.stderr.write("Your Python version %d.%d.%d is not supported.\n" % sys.version_info[:3])
9
+	sys.stderr.write("S3cmd required Python 2.4 or newer.\n")
10
+	sys.exit(1)
11
+
12
+try:
13
+	import elementtree.ElementTree as ET
14
+except ImportError, e:
15
+	sys.stderr.write(e.message + "\n")
16
+	sys.stderr.write("Please upgrade to Python 2.5 or install ElementTree module\n")
17
+	sys.stderr.write("from http://effbot.org/zone/element-index.htm\n")
18
+	sys.exit(1)
19
+
7 20
 try:
8 21
 	## Remove 'MANIFEST' file to force
9 22
 	## distutils to recreate it.