summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>2000-02-10 02:51:32 (GMT)
committerGreg Ward <gward@python.net>2000-02-10 02:51:32 (GMT)
commit10ca82b57cab91eb06219556c123f81f699dabed (patch)
treedc9fc5ad7cbe120b0367834a085835ac1d2fbbd4
parent968d883be5bd20647d764badcca1621e4bc697c9 (diff)
downloadcpython-10ca82b57cab91eb06219556c123f81f699dabed.zip
cpython-10ca82b57cab91eb06219556c123f81f699dabed.tar.gz
cpython-10ca82b57cab91eb06219556c123f81f699dabed.tar.bz2
Typecheck 'output_dir' argument to compile/link methods.
-rw-r--r--Lib/distutils/unixccompiler.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py
index cc0d772..770a543 100644
--- a/Lib/distutils/unixccompiler.py
+++ b/Lib/distutils/unixccompiler.py
@@ -106,6 +106,8 @@ class UnixCCompiler (CCompiler):
extra_preargs=None,
extra_postargs=None):
+ if type (output_dir) not in (StringType, NoneType):
+ raise TypeError, "'output_dir' must be a string or None"
if output_dir is None:
output_dir = self.output_dir
if macros is None:
@@ -205,6 +207,8 @@ class UnixCCompiler (CCompiler):
"'objects' must be a list or tuple of strings"
objects = list (objects)
+ if type (output_dir) not in (StringType, NoneType):
+ raise TypeError, "'output_dir' must be a string or None"
if output_dir is None:
output_dir = self.output_dir
@@ -270,6 +274,8 @@ class UnixCCompiler (CCompiler):
lib_opts = gen_lib_options (self,
self.library_dirs + library_dirs,
self.libraries + libraries)
+ if type (output_dir) not in (StringType, NoneType):
+ raise TypeError, "'output_dir' must be a string or None"
if output_dir is not None:
output_filename = os.path.join (output_dir, output_filename)