* 'VirtualMailManager/Exceptions.py'
authorPascal Volk <neverseen@users.sourceforge.net>
Sat, 23 Aug 2008 22:25:21 +0000
changeset 61 d85482575349
parent 60 ac2fa80d9faf
child 62 869de537a020
* 'VirtualMailManager/Exceptions.py' - Fixed AttributeError in class VMMException on older Python installations. (VMMException instance has no attribute 'message') * 'vmm' - let show_version() print more details
VirtualMailManager/Exceptions.py
vmm
--- a/VirtualMailManager/Exceptions.py	Sat Aug 23 20:30:36 2008 +0000
+++ b/VirtualMailManager/Exceptions.py	Sat Aug 23 22:25:21 2008 +0000
@@ -18,6 +18,9 @@
     def __init__(self, msg, code):
         Exception.__init__(self, msg)
         self._code = int(code)
+        ### for older python versions, like py 2.4.4 on OpenBSD 4.2
+        if not hasattr(self, 'message'):
+            self.message = msg
 
     def msg(self):
         """Returns the exception message."""
--- a/vmm	Sat Aug 23 20:30:36 2008 +0000
+++ b/vmm	Sat Aug 23 22:25:21 2008 +0000
@@ -346,9 +346,10 @@
             w_std( " * %s" % warning)
 
 def show_version():
-    w_std("%s, %s %s (%s %s %s)\n" % (__prog__, _('version'), __version__,
-            __revision__, _('from'), strftime(locale.nl_langinfo(locale.D_FMT),
-                strptime(__date__, '%Y-%m-%d'))))
+    w_std("%s, %s %s (%s %s %s)\nPython %s %s %s\n" % (__prog__, _('version'),
+        __version__, __revision__, _('from'), strftime(
+            locale.nl_langinfo(locale.D_FMT), strptime(__date__, '%Y-%m-%d')),
+        sys.version.split()[0], _('on'), sys.platform.title()))
 
 #def main():
 if __name__ == '__main__':