diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 1995-10-09 23:09:23 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 1995-10-09 23:09:23 (GMT) |
commit | 732151473b9528302518c54a48e5767bc7746200 (patch) | |
tree | a389819ea5b17bf848c85eb8219d2b9cb6416a20 /Mac/scripts/gensuitemodule.py | |
parent | a1db48b75b88b1fdb36b96dd3dac59abfc1e9abe (diff) | |
download | cpython-732151473b9528302518c54a48e5767bc7746200.zip cpython-732151473b9528302518c54a48e5767bc7746200.tar.gz cpython-732151473b9528302518c54a48e5767bc7746200.tar.bz2 |
Fixed bug in optional argument error checking (and generated all
suites anew).
Diffstat (limited to 'Mac/scripts/gensuitemodule.py')
-rw-r--r-- | Mac/scripts/gensuitemodule.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/Mac/scripts/gensuitemodule.py b/Mac/scripts/gensuitemodule.py index cd94725..a2e22e0 100644 --- a/Mac/scripts/gensuitemodule.py +++ b/Mac/scripts/gensuitemodule.py @@ -311,6 +311,16 @@ def compileevent(fp, event): # fp.write("\t\t_code = %s\n"% `code`) fp.write("\t\t_subcode = %s\n\n"% `subcode`) + # + # Do keyword name substitution + # + if arguments: + fp.write("\t\taetools.keysubst(_arguments, self._argmap_%s)\n"%funcname) + else: + fp.write("\t\tif _arguments: raise TypeError, 'No optional args expected'\n") + # + # Stuff required arg (if there is one) into arguments + # if has_arg: fp.write("\t\t_arguments['----'] = _object\n") elif opt_arg: @@ -320,12 +330,8 @@ def compileevent(fp, event): fp.write("\t\tif _no_object != None: raise TypeError, 'No direct arg expected'\n") fp.write("\n") # - # Do key substitution + # Do enum-name substitution # - if arguments: - fp.write("\t\taetools.keysubst(_arguments, self._argmap_%s)\n"%funcname) - else: - fp.write("\t\tif _arguments: raise TypeError, 'No optional args expected'\n") for a in arguments: if is_enum(a[2]): kname = a[1] |