@@ -111,7 +111,7 @@ def keysubst(arguments, keydict):
111111 del arguments [k ]
112112 arguments [keydict [k ]] = v
113113 elif k != '----' and k not in ok :
114- raise TypeError , 'Unknown keyword argument: %s' % k
114+ raise TypeError ( 'Unknown keyword argument: %s' % k )
115115
116116def enumsubst (arguments , key , edict ):
117117 """Substitute a single enum keyword argument, if it occurs"""
@@ -122,7 +122,7 @@ def enumsubst(arguments, key, edict):
122122 if v in edict :
123123 arguments [key ] = Enum (edict [v ])
124124 elif not v in ok :
125- raise TypeError , 'Unknown enumerator: %s' % v
125+ raise TypeError ( 'Unknown enumerator: %s' % v )
126126
127127def decodeerror (arguments ):
128128 """Create the 'best' argument for a raise MacOS.Error"""
@@ -174,7 +174,7 @@ def __init__(self, signature=None, start=0, timeout=0):
174174 self .target = AE .AECreateDesc (AppleEvents .typeApplSignature , signature )
175175 self .target_signature = signature
176176 else :
177- raise TypeError , "signature should be 4-char string or AEDesc"
177+ raise TypeError ( "signature should be 4-char string or AEDesc" )
178178 self .send_flags = AppleEvents .kAEWaitReply
179179 self .send_priority = AppleEvents .kAENormalPriority
180180 if timeout :
@@ -214,7 +214,7 @@ def newevent(self, code, subcode, parameters = {}, attributes = {}):
214214 def sendevent (self , event ):
215215 """Send a pre-created appleevent, await the reply and unpack it"""
216216 if not self .__ensure_WMAvailable ():
217- raise RuntimeError , "No window manager access, cannot send AppleEvent"
217+ raise RuntimeError ( "No window manager access, cannot send AppleEvent" )
218218 reply = event .AESend (self .send_flags , self .send_priority ,
219219 self .send_timeout )
220220 parameters , attributes = unpackevent (reply , self ._moduleName )
@@ -248,7 +248,7 @@ def _get(self, _object, asfile=None, _attributes={}):
248248 _reply , _arguments , _attributes = self .send (_code , _subcode ,
249249 _arguments , _attributes )
250250 if 'errn' in _arguments :
251- raise Error , decodeerror (_arguments )
251+ raise Error ( decodeerror (_arguments ) )
252252
253253 if '----' in _arguments :
254254 return _arguments ['----' ]
@@ -278,7 +278,7 @@ def _set(self, _object, _attributes={}, **_arguments):
278278 _reply , _arguments , _attributes = self .send (_code , _subcode ,
279279 _arguments , _attributes )
280280 if _arguments .get ('errn' , 0 ):
281- raise Error , decodeerror (_arguments )
281+ raise Error ( decodeerror (_arguments ) )
282282 # XXXX Optionally decode result
283283 if '----' in _arguments :
284284 return _arguments ['----' ]
@@ -295,7 +295,7 @@ def __getattr__(self, name):
295295 if name in self ._propdict :
296296 cls = self ._propdict [name ]
297297 return cls ()
298- raise AttributeError , name
298+ raise AttributeError ( name )
299299
300300# Tiny Finder class, for local use only
301301
@@ -308,14 +308,14 @@ def open(self, _object, _attributes={}, **_arguments):
308308 _code = 'aevt'
309309 _subcode = 'odoc'
310310
311- if _arguments : raise TypeError , 'No optional args expected'
311+ if _arguments : raise TypeError ( 'No optional args expected' )
312312 _arguments ['----' ] = _object
313313
314314
315315 _reply , _arguments , _attributes = self .send (_code , _subcode ,
316316 _arguments , _attributes )
317317 if 'errn' in _arguments :
318- raise Error , decodeerror (_arguments )
318+ raise Error ( decodeerror (_arguments ) )
319319 # XXXX Optionally decode result
320320 if '----' in _arguments :
321321 return _arguments ['----' ]
0 commit comments