diff options
Diffstat (limited to 'Lib/distutils/tests/support.py')
-rw-r--r-- | Lib/distutils/tests/support.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/distutils/tests/support.py b/Lib/distutils/tests/support.py index 84d9232328..7385c6bbf6 100644 --- a/Lib/distutils/tests/support.py +++ b/Lib/distutils/tests/support.py @@ -32,14 +32,15 @@ class LoggingSilencer(object): def _log(self, level, msg, args): if level not in (DEBUG, INFO, WARN, ERROR, FATAL): raise ValueError('%s wrong log level' % str(level)) + if not isinstance(msg, str): + raise TypeError("msg should be str, not '%.200s'" + % (type(msg).__name__)) self.logs.append((level, msg, args)) def get_logs(self, *levels): def _format(msg, args): - if len(args) == 0: - return msg return msg % args - return [_format(msg, args) for level, msg, args + return [msg % args for level, msg, args in self.logs if level in levels] def clear_logs(self): @@ -206,4 +207,4 @@ def fixup_build_ext(cmd): cmd.library_dirs = [] else: name, equals, value = runshared.partition('=') - cmd.library_dirs = value.split(os.pathsep) + cmd.library_dirs = [d for d in value.split(os.pathsep) if d] |