Browse code

* S3/Exceptions.py: Remove DeprecationWarning about BaseException.message in Python 2.6

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

Michal Ludvig authored on 2009/01/24 20:41:22
Showing 2 changed files
... ...
@@ -1,6 +1,8 @@
1 1
 2009-01-25  Michal Ludvig  <michal@logix.cz>
2 2
 
3 3
 	* s3cmd: Enabled --dry-run and --exclude for 'put' and 'get'.
4
+	* S3/Exceptions.py: Remove DeprecationWarning about 
5
+	  BaseException.message in Python 2.6
4 6
 
5 7
 2009-01-22  Michal Ludvig  <michal@logix.cz>
6 8
 
... ...
@@ -21,6 +21,14 @@ class S3Exception(Exception):
21 21
 	def __unicode__(self):
22 22
 		return self.message
23 23
 
24
+	## (Base)Exception.message has been deprecated in Python 2.6
25
+	def _get_message(self):
26
+		return self._message
27
+	def _set_message(self, message):
28
+		self._message = message
29
+	message = property(_get_message, _set_message)
30
+
31
+
24 32
 class S3Error (S3Exception):
25 33
 	def __init__(self, response):
26 34
 		self.status = response["status"]