0
0
mirror of https://github.com/python/cpython.git synced 2024-11-24 17:47:13 +01:00

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

This commit is contained in:
Greg Ward 1999-09-21 18:35:09 +00:00
parent d4b8429fc5
commit fbf8affca1

View File

@ -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: