[Zconfig] SVN: ZConfig/trunk/ZConfig/__init__.py merge the matt-python-2.6 branch:

Fred L. Drake, Jr. fdrake at gmail.com
Fri Dec 5 12:47:09 EST 2008


Log message for revision 93658:
  merge the matt-python-2.6 branch:
  svn merge svn+ssh://svn.zope.org/repos/main/ZConfig/branches/matt-python-2.6 -r93095:93653
  
  avoids triggering deprecation warnings on Python 2.6, 2.6.1
  

Changed:
  U   ZConfig/trunk/ZConfig/__init__.py

-=-
Modified: ZConfig/trunk/ZConfig/__init__.py
===================================================================
--- ZConfig/trunk/ZConfig/__init__.py	2008-12-05 17:46:27 UTC (rev 93657)
+++ ZConfig/trunk/ZConfig/__init__.py	2008-12-05 17:47:08 UTC (rev 93658)
@@ -44,7 +44,20 @@
 
 class ConfigurationError(Exception):
     """Base class for ZConfig exceptions."""
+ 
+    # The 'message' attribute was deprecated for BaseException with
+    # Python 2.6; here we create descriptor properties to continue using it
+    def __set_message(self, v):
+        self.__dict__['message'] = v
 
+    def __get_message(self):
+        return self.__dict__['message']
+
+    def __del_message(self):
+        del self.__dict__['message']
+
+    message = property(__get_message, __set_message, __del_message)
+
     def __init__(self, msg, url=None):
         self.message = msg
         self.url = url



More information about the ZConfig mailing list