mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Raise a more intellegible error in the case of missing keyword args
This commit is contained in:
parent
ae178eaea6
commit
b7e82c1c0c
1 changed files with 9 additions and 2 deletions
|
@ -128,9 +128,16 @@ class AEServer:
|
||||||
if _parameters.has_key('----'):
|
if _parameters.has_key('----'):
|
||||||
_object = _parameters['----']
|
_object = _parameters['----']
|
||||||
del _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:
|
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:
|
if rv == None:
|
||||||
aetools.packevent(_reply, {})
|
aetools.packevent(_reply, {})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue