diff options
author | Greg Ward <gward@python.net> | 2000-02-10 02:51:32 (GMT) |
---|---|---|
committer | Greg Ward <gward@python.net> | 2000-02-10 02:51:32 (GMT) |
commit | 10ca82b57cab91eb06219556c123f81f699dabed (patch) | |
tree | dc9fc5ad7cbe120b0367834a085835ac1d2fbbd4 | |
parent | 968d883be5bd20647d764badcca1621e4bc697c9 (diff) | |
download | cpython-10ca82b57cab91eb06219556c123f81f699dabed.zip cpython-10ca82b57cab91eb06219556c123f81f699dabed.tar.gz cpython-10ca82b57cab91eb06219556c123f81f699dabed.tar.bz2 |
Typecheck 'output_dir' argument to compile/link methods.
-rw-r--r-- | Lib/distutils/unixccompiler.py | 6 |
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) |