summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1996-10-23 15:43:04 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1996-10-23 15:43:04 (GMT)
commitb7e82c1c0c3370eec1891b3b7dcb08c8946fbd27 (patch)
treedb158d89b53443a4ea63f69deafaa7a2df284c1c
parentae178eaea6eb5024a5cb25fa20b226994395f66c (diff)
downloadcpython-b7e82c1c0c3370eec1891b3b7dcb08c8946fbd27.zip
cpython-b7e82c1c0c3370eec1891b3b7dcb08c8946fbd27.tar.gz
cpython-b7e82c1c0c3370eec1891b3b7dcb08c8946fbd27.tar.bz2
Raise a more intellegible error in the case of missing keyword args
-rw-r--r--Mac/Lib/toolbox/MiniAEFrame.py11
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, {})