Convert raise statements in Mac/.
authorCollin Winter <collinw@gmail.com>
Wed, 22 Aug 2007 23:05:23 +0000 (23:05 +0000)
committerCollin Winter <collinw@gmail.com>
Wed, 22 Aug 2007 23:05:23 +0000 (23:05 +0000)
Mac/Demo/applescript/Disk_Copy/Special_Events.py
Mac/Demo/applescript/Disk_Copy/Standard_Suite.py
Mac/Demo/applescript/Disk_Copy/Utility_Events.py
Mac/Modules/cf/cfsupport.py
Mac/Modules/file/filesupport.py
Mac/Modules/list/listsupport.py
Mac/Modules/te/tesupport.py
Mac/Tools/Doc/HelpIndexingTool/Help_Indexing_Tool_Suite.py
Mac/Tools/Doc/HelpIndexingTool/Miscellaneous_Standards.py
Mac/Tools/Doc/HelpIndexingTool/Standard_Suite.py
Mac/Tools/Doc/HelpIndexingTool/odds_and_ends.py

index a2b09107dceb37e0f9b520081356d7b654ee6cee..2c7e04f1450fa8a1d4d0291bcafccfc68855c40f 100644 (file)
@@ -43,7 +43,7 @@ class Special_Events_Events:
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                         _arguments, _attributes)
         if _arguments.has_key('errn'):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']
@@ -72,7 +72,7 @@ class Special_Events_Events:
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                         _arguments, _attributes)
         if _arguments.has_key('errn'):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']
@@ -85,14 +85,14 @@ class Special_Events_Events:
         _code = 'ddsk'
         _subcode = 'Umnt'
 
-        if _arguments: raise TypeError, 'No optional args expected'
+        if _arguments: raise TypeError('No optional args expected')
         _arguments['----'] = _object
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                         _arguments, _attributes)
         if _arguments.has_key('errn'):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']
@@ -131,7 +131,7 @@ class Special_Events_Events:
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                         _arguments, _attributes)
         if _arguments.has_key('errn'):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']
@@ -145,14 +145,14 @@ class Special_Events_Events:
         _code = 'ddsk'
         _subcode = 'Vcrc'
 
-        if _arguments: raise TypeError, 'No optional args expected'
+        if _arguments: raise TypeError('No optional args expected')
         _arguments['----'] = _object
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                         _arguments, _attributes)
         if _arguments.has_key('errn'):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']
@@ -166,14 +166,14 @@ class Special_Events_Events:
         _code = 'ddsk'
         _subcode = 'Vsig'
 
-        if _arguments: raise TypeError, 'No optional args expected'
+        if _arguments: raise TypeError('No optional args expected')
         _arguments['----'] = _object
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                         _arguments, _attributes)
         if _arguments.has_key('errn'):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']
@@ -199,7 +199,7 @@ class Special_Events_Events:
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                         _arguments, _attributes)
         if _arguments.has_key('errn'):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']
@@ -231,7 +231,7 @@ class Special_Events_Events:
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                         _arguments, _attributes)
         if _arguments.has_key('errn'):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']
@@ -258,7 +258,7 @@ class Special_Events_Events:
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                         _arguments, _attributes)
         if _arguments.has_key('errn'):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']
@@ -290,7 +290,7 @@ class Special_Events_Events:
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                         _arguments, _attributes)
         if _arguments.has_key('errn'):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']
@@ -331,7 +331,7 @@ class Special_Events_Events:
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                         _arguments, _attributes)
         if _arguments.has_key('errn'):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']
index 455e78dfa9f4842972e5ce595331da3767b6ba22..2dad947990169a98c2490cd98e01106621a30aa3 100644 (file)
@@ -58,7 +58,7 @@ class Standard_Suite_Events:
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                         _arguments, _attributes)
         if _arguments.has_key('errn'):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']
@@ -71,14 +71,14 @@ class Standard_Suite_Events:
         _code = 'core'
         _subcode = 'dosc'
 
-        if _arguments: raise TypeError, 'No optional args expected'
+        if _arguments: raise TypeError('No optional args expected')
         _arguments['----'] = _object
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                         _arguments, _attributes)
         if _arguments.has_key('errn'):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']
index 172b40819c8fd3b7aa2e9b55c59fd6ad39a2eaca..03df9387a36f319c5311eb5eee94d3211d12a8bc 100644 (file)
@@ -26,14 +26,14 @@ class Utility_Events_Events:
         _subcode = 'SEL1'
 
         aetools.keysubst(_arguments, self._argmap_select_disk_image)
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object != None: raise TypeError('No direct arg expected')
 
         aetools.enumsubst(_arguments, 'SELp', _Enum_TEXT)
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                         _arguments, _attributes)
         if _arguments.has_key('errn'):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']
@@ -52,14 +52,14 @@ class Utility_Events_Events:
         _subcode = 'SEL2'
 
         aetools.keysubst(_arguments, self._argmap_select_DiskScript)
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object != None: raise TypeError('No direct arg expected')
 
         aetools.enumsubst(_arguments, 'SELp', _Enum_TEXT)
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                         _arguments, _attributes)
         if _arguments.has_key('errn'):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']
@@ -78,14 +78,14 @@ class Utility_Events_Events:
         _subcode = 'SEL3'
 
         aetools.keysubst(_arguments, self._argmap_select_disk_image_or_DiskScript)
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object != None: raise TypeError('No direct arg expected')
 
         aetools.enumsubst(_arguments, 'SELp', _Enum_TEXT)
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                         _arguments, _attributes)
         if _arguments.has_key('errn'):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']
@@ -104,14 +104,14 @@ class Utility_Events_Events:
         _subcode = 'SEL4'
 
         aetools.keysubst(_arguments, self._argmap_select_floppy_disk_image)
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object != None: raise TypeError('No direct arg expected')
 
         aetools.enumsubst(_arguments, 'SELp', _Enum_TEXT)
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                         _arguments, _attributes)
         if _arguments.has_key('errn'):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']
@@ -130,14 +130,14 @@ class Utility_Events_Events:
         _subcode = 'SEL5'
 
         aetools.keysubst(_arguments, self._argmap_select_disk)
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object != None: raise TypeError('No direct arg expected')
 
         aetools.enumsubst(_arguments, 'SELp', _Enum_TEXT)
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                         _arguments, _attributes)
         if _arguments.has_key('errn'):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']
@@ -156,14 +156,14 @@ class Utility_Events_Events:
         _subcode = 'SEL6'
 
         aetools.keysubst(_arguments, self._argmap_select_folder)
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object != None: raise TypeError('No direct arg expected')
 
         aetools.enumsubst(_arguments, 'SELp', _Enum_TEXT)
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                         _arguments, _attributes)
         if _arguments.has_key('errn'):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']
@@ -189,7 +189,7 @@ class Utility_Events_Events:
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                         _arguments, _attributes)
         if _arguments.has_key('errn'):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']
index 655331eb2a8b810b0bf5bbc82e1af7c213e83294..23c85981ff20a8743f5c61674968e16340ac74d5 100644 (file)
@@ -24,14 +24,14 @@ class MethodSkipArg1(MethodGenerator):
 
     def parseArgumentList(self, args):
         if len(args) < 2:
-            raise ValueError, "MethodSkipArg1 expects at least 2 args"
+            raise ValueError("MethodSkipArg1 expects at least 2 args")
         a0, a1, args = args[0], args[1], args[2:]
         t0, n0, m0 = a0
         if t0 != "CFAllocatorRef" and m0 != InMode:
-            raise ValueError, "MethodSkipArg1 should have dummy AllocatorRef first arg"
+            raise ValueError("MethodSkipArg1 should have dummy AllocatorRef first arg")
         t1, n1, m1 = a1
         if m1 != InMode:
-            raise ValueError, "method's 'self' must be 'InMode'"
+            raise ValueError("method's 'self' must be 'InMode'")
         dummy = Variable(t0, n0, m0)
         self.argumentList.append(dummy)
         self.itself = Variable(t1, "_self->ob_itself", SelfMode)
index de45ed40420170fa00bb370e4eb54adb5b86963c..82117242eefd1cc7e011e52469d5bb34204d57f3 100644 (file)
@@ -774,7 +774,7 @@ class Arg2MethodGenerator(OSErrMethodGenerator):
         t0, n0, m0 = arg1
         args = args0 + argsrest
         if m0 != InMode:
-            raise ValueError, "method's 'self' must be 'InMode'"
+            raise ValueError("method's 'self' must be 'InMode'")
         self.itself = Variable(t0, "_self->ob_itself", SelfMode)
         FunctionGenerator.parseArgumentList(self, args)
         self.argumentList.insert(2, self.itself)
index 2e1144a9b645d7a4d6f2277afe96f21a38bb2c28..1c122065cb9bb1f9ddde2a6f74cb6f1c110caf8f 100644 (file)
@@ -70,7 +70,7 @@ class ListMethodGenerator(MethodGenerator):
         args, a0 = args[:-1], args[-1]
         t0, n0, m0 = a0
         if m0 != InMode:
-            raise ValueError, "method's 'self' must be 'InMode'"
+            raise ValueError("method's 'self' must be 'InMode'")
         self.itself = Variable(t0, "_self->ob_itself", SelfMode)
         FunctionGenerator.parseArgumentList(self, args)
         self.argumentList.append(self.itself)
index 412d5e7234682d4aecbfef348b09dc3706330855..96c9604c7df38fcbd1e11bab622bd2668fab5177 100644 (file)
@@ -82,7 +82,7 @@ class TEMethodGenerator(OSErrWeakLinkMethodGenerator):
         args, a0 = args[:-1], args[-1]
         t0, n0, m0 = a0
         if m0 != InMode:
-            raise ValueError, "method's 'self' must be 'InMode'"
+            raise ValueError("method's 'self' must be 'InMode'")
         self.itself = Variable(t0, "_self->ob_itself", SelfMode)
         FunctionGenerator.parseArgumentList(self, args)
         self.argumentList.append(self.itself)
index 58d73076dfbd54a9d9d40dd911d55c80ee878402..9b3ace4631bf53754d4727102fa664f8039af983 100644 (file)
@@ -20,14 +20,14 @@ class Help_Indexing_Tool_Suite_Events:
         _code = 'HIT '
         _subcode = 'tAnc'
 
-        if _arguments: raise TypeError, 'No optional args expected'
+        if _arguments: raise TypeError('No optional args expected')
         _arguments['----'] = _object
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                 _arguments, _attributes)
         if _arguments.get('errn', 0):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']
@@ -52,7 +52,7 @@ class Help_Indexing_Tool_Suite_Events:
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                 _arguments, _attributes)
         if _arguments.get('errn', 0):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']
@@ -65,14 +65,14 @@ class Help_Indexing_Tool_Suite_Events:
         _code = 'HIT '
         _subcode = 'uTok'
 
-        if _arguments: raise TypeError, 'No optional args expected'
+        if _arguments: raise TypeError('No optional args expected')
         _arguments['----'] = _object
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                 _arguments, _attributes)
         if _arguments.get('errn', 0):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']
index 3cf745f9860edd36294f4466cd967c5f96989ecd..616ae70b4a2a7130f688e4805f3d55520af89b5a 100644 (file)
@@ -20,14 +20,14 @@ class Miscellaneous_Standards_Events:
         _code = 'misc'
         _subcode = 'rvrt'
 
-        if _arguments: raise TypeError, 'No optional args expected'
+        if _arguments: raise TypeError('No optional args expected')
         _arguments['----'] = _object
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                 _arguments, _attributes)
         if _arguments.get('errn', 0):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']
index 4f6604cfebec5fed8962b97f9c60fbf9dc141b47..140e8b98fd2643fd13d0d17d18f83dd5502d3b9f 100644 (file)
@@ -36,7 +36,7 @@ class Standard_Suite_Events(Standard_Suite_Events):
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                 _arguments, _attributes)
         if _arguments.get('errn', 0):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']
@@ -50,14 +50,14 @@ class Standard_Suite_Events(Standard_Suite_Events):
         _code = 'core'
         _subcode = 'dsiz'
 
-        if _arguments: raise TypeError, 'No optional args expected'
+        if _arguments: raise TypeError('No optional args expected')
         _arguments['----'] = _object
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                 _arguments, _attributes)
         if _arguments.get('errn', 0):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']
@@ -71,14 +71,14 @@ class Standard_Suite_Events(Standard_Suite_Events):
         _code = 'core'
         _subcode = 'getd'
 
-        if _arguments: raise TypeError, 'No optional args expected'
+        if _arguments: raise TypeError('No optional args expected')
         _arguments['----'] = _object
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                 _arguments, _attributes)
         if _arguments.get('errn', 0):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']
@@ -103,13 +103,13 @@ class Standard_Suite_Events(Standard_Suite_Events):
         _subcode = 'crel'
 
         aetools.keysubst(_arguments, self._argmap_make)
-        if _no_object != None: raise TypeError, 'No direct arg expected'
+        if _no_object != None: raise TypeError('No direct arg expected')
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                 _arguments, _attributes)
         if _arguments.get('errn', 0):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']
@@ -122,14 +122,14 @@ class Standard_Suite_Events(Standard_Suite_Events):
         _code = 'aevt'
         _subcode = 'odoc'
 
-        if _arguments: raise TypeError, 'No optional args expected'
+        if _arguments: raise TypeError('No optional args expected')
         _arguments['----'] = _object
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                 _arguments, _attributes)
         if _arguments.get('errn', 0):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']
@@ -142,14 +142,14 @@ class Standard_Suite_Events(Standard_Suite_Events):
         _code = 'aevt'
         _subcode = 'pdoc'
 
-        if _arguments: raise TypeError, 'No optional args expected'
+        if _arguments: raise TypeError('No optional args expected')
         _arguments['----'] = _object
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                 _arguments, _attributes)
         if _arguments.get('errn', 0):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']
@@ -176,7 +176,7 @@ class Standard_Suite_Events(Standard_Suite_Events):
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                 _arguments, _attributes)
         if _arguments.get('errn', 0):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']
@@ -201,7 +201,7 @@ class Standard_Suite_Events(Standard_Suite_Events):
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                 _arguments, _attributes)
         if _arguments.get('errn', 0):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']
index 7ee46f35cc292d07d64afa373896e479d0b5bd82..86ecb95c963c0840fb9178f49bb4ef4ee12c7bc8 100644 (file)
@@ -20,14 +20,14 @@ class odds_and_ends_Events:
         _code = 'misc'
         _subcode = 'slct'
 
-        if _arguments: raise TypeError, 'No optional args expected'
+        if _arguments: raise TypeError('No optional args expected')
         _arguments['----'] = _object
 
 
         _reply, _arguments, _attributes = self.send(_code, _subcode,
                 _arguments, _attributes)
         if _arguments.get('errn', 0):
-            raise aetools.Error, aetools.decodeerror(_arguments)
+            raise aetools.Error(aetools.decodeerror(_arguments))
         # XXXX Optionally decode result
         if _arguments.has_key('----'):
             return _arguments['----']