diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 1996-10-23 15:43:04 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 1996-10-23 15:43:04 (GMT) |
commit | b7e82c1c0c3370eec1891b3b7dcb08c8946fbd27 (patch) | |
tree | db158d89b53443a4ea63f69deafaa7a2df284c1c /Mac/Lib | |
parent | ae178eaea6eb5024a5cb25fa20b226994395f66c (diff) | |
download | cpython-b7e82c1c0c3370eec1891b3b7dcb08c8946fbd27.zip cpython-b7e82c1c0c3370eec1891b3b7dcb08c8946fbd27.tar.gz cpython-b7e82c1c0c3370eec1891b3b7dcb08c8946fbd27.tar.bz2 |
Raise a more intellegible error in the case of missing keyword args
Diffstat (limited to 'Mac/Lib')
-rw-r--r-- | Mac/Lib/toolbox/MiniAEFrame.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Mac/Lib/toolbox/MiniAEFrame.py b/Mac/Lib/toolbox/MiniAEFrame.py index d492d27..549b3ee 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, {}) |