commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnue] r7132 - trunk/gnue-common/src/apps


From: reinhard
Subject: [gnue] r7132 - trunk/gnue-common/src/apps
Date: Tue, 8 Mar 2005 14:47:46 -0600 (CST)

Author: reinhard
Date: 2005-03-08 14:47:45 -0600 (Tue, 08 Mar 2005)
New Revision: 7132

Modified:
   trunk/gnue-common/src/apps/checktype.py
Log:
Derive TypeError from gException so non-ASCII characters in the error message
are handeled properly.


Modified: trunk/gnue-common/src/apps/checktype.py
===================================================================
--- trunk/gnue-common/src/apps/checktype.py     2005-03-08 20:24:36 UTC (rev 
7131)
+++ trunk/gnue-common/src/apps/checktype.py     2005-03-08 20:47:45 UTC (rev 
7132)
@@ -28,13 +28,14 @@
 import string
 import sys
 
-from gnue.common.apps import i18n
+from gnue.common.apps import errors, i18n
 
+
 # -----------------------------------------------------------------------------
-# Exceptions
+# Exception definition
 # -----------------------------------------------------------------------------
 
-class TypeError (Exception):
+class TypeError (gException):
   """
   Raised when L{checktype} detects a wrong type.
 
@@ -77,8 +78,9 @@
                  'expected': self.__stringify (self.expected),
                  'actual'  : self.__stringify (self.actual),
                  'value'   : repr (self.value)}
-    Exception.__init__ (self, message)
+    gException.__init__ (self, message)
 
+
 # -----------------------------------------------------------------------------
 # Check type of a variable
 # -----------------------------------------------------------------------------
@@ -102,6 +104,7 @@
       return
   raise TypeError, (variable, validtype)
 
+
 # -----------------------------------------------------------------------------
 # Module initialization
 # -----------------------------------------------------------------------------
@@ -109,6 +112,7 @@
 import __builtin__  
 __builtin__.__dict__['checktype'] = checktype
 
+
 # -----------------------------------------------------------------------------
 # Self test code
 # -----------------------------------------------------------------------------





reply via email to

[Prev in Thread] Current Thread [Next in Thread]