Kaydet (Commit) fbf8affc authored tarafından Greg Ward's avatar Greg Ward

Typecheck elements of 'macros' parameter in 'gen_preprocess_options().

üst d4b8429f
......@@ -450,6 +450,14 @@ def gen_preprocess_options (macros, includes):
pp_opts = []
for macro in macros:
if not (type (macro) is TupleType and
1 <= len (macro) <= 2):
raise TypeError, \
("bad macro definition '%s': " +
"each element of 'macros' list must be a 1- or 2-tuple") % \
macro
if len (macro) == 1: # undefine this macro
pp_opts.append ("-U%s" % macro[0])
elif len (macro) == 2:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment