summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>1999-09-21 18:35:09 (GMT)
committerGreg Ward <gward@python.net>1999-09-21 18:35:09 (GMT)
commitfbf8affca1a5eb139e794ae91c14ae6ccef2fc19 (patch)
tree3f55d857b7f57ca3034207518e8d70c0af0e03af /Lib
parentd4b8429fc506267a4da3bcf135d8b7f8780379f3 (diff)
downloadcpython-fbf8affca1a5eb139e794ae91c14ae6ccef2fc19.zip
cpython-fbf8affca1a5eb139e794ae91c14ae6ccef2fc19.tar.gz
cpython-fbf8affca1a5eb139e794ae91c14ae6ccef2fc19.tar.bz2
Typecheck elements of 'macros' parameter in 'gen_preprocess_options().
Diffstat (limited to 'Lib')
-rw-r--r--Lib/distutils/ccompiler.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/distutils/ccompiler.py b/Lib/distutils/ccompiler.py
index 0e50533..2a80739 100644
--- a/Lib/distutils/ccompiler.py
+++ b/Lib/distutils/ccompiler.py
@@ -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: