mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Typecheck elements of 'macros' parameter in 'gen_preprocess_options().
This commit is contained in:
parent
d4b8429fc5
commit
fbf8affca1
1 changed files with 8 additions and 0 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue