From 732151473b9528302518c54a48e5767bc7746200 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Mon, 9 Oct 1995 23:09:23 +0000 Subject: Fixed bug in optional argument error checking (and generated all suites anew). --- Mac/scripts/gensuitemodule.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'Mac/scripts/gensuitemodule.py') diff --git a/Mac/scripts/gensuitemodule.py b/Mac/scripts/gensuitemodule.py index cd9472551f..a2e22e0bae 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] -- cgit v1.2.1