From: Jack Jansen Date: Wed, 23 Oct 1996 15:43:04 +0000 (+0000) Subject: Raise a more intellegible error in the case of missing keyword args X-Git-Tag: v1.4~42 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b7e82c1c0c3370eec1891b3b7dcb08c8946fbd27;p=python Raise a more intellegible error in the case of missing keyword args --- diff --git a/Mac/Lib/toolbox/MiniAEFrame.py b/Mac/Lib/toolbox/MiniAEFrame.py index d492d27da8..549b3ee738 100644 --- a/Mac/Lib/toolbox/MiniAEFrame.py +++ b/Mac/Lib/toolbox/MiniAEFrame.py @@ -128,9 +128,16 @@ class AEServer: if _parameters.has_key('----'): _object = _parameters['----'] del _parameters['----'] - rv = apply(_function, (_object,), _parameters) + print 'XXX', (_function, (_object,), _parameters) + try: + rv = apply(_function, (_object,), _parameters) + except TypeError, name: + raise TypeError, ('AppleEvent handler misses formal keyword argument', _function, name) else: - rv = apply(_function, (), _parameters) + try: + rv = apply(_function, (), _parameters) + except TypeError, name: + raise TypeError, ('AppleEvent handler misses formal keyword argument', _function, name) if rv == None: aetools.packevent(_reply, {})