From 10ca82b57cab91eb06219556c123f81f699dabed Mon Sep 17 00:00:00 2001 From: Greg Ward Date: Thu, 10 Feb 2000 02:51:32 +0000 Subject: Typecheck 'output_dir' argument to compile/link methods. --- Lib/distutils/unixccompiler.py | 6 ++++++ 1 file changed, 6 insertions(+) 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) -- cgit v0.12